Sunday 23 August 2020

Object State & Context.

About.

State / pl: 'stan' / can be defined in many ways.


Finite State Machine.

A finite-state machine (FSM) / pl: automat skończenie stanowy / is a mathematical model of computation. It is an abstract machine that can be in exactly one of a finite number of states at any given time. The FSM can change from one state to another in response to some inputs; the change from one state to another is called a transition
/ pl: 'przejście', 'funkcja przejścia' /. An FSM is defined by a list of its states, its initial state / pl: 'stan początkowy' /, optionally acceptance (final) state(s) / pl: 'stan(y) akceptujący(-e)', 'stan(y) końcowy(-e)' /, transitions, and the inputs that trigger each transition.

... for more, feel free to look: [ Finite-state machine on Wikipedia ].


Finite State Object.

One can look at object, at it's variables. Variables can be - and are - represented as list of 0's and 1's. Variable values can be concatenated into one list. All of possible permutations of 0's and 1's in this list represent all of possible of this object's states.

Similarly, object's methods can be seen as 'families' of transition functions / pl: 'rodziny funkcji przejścia' / between object's possible states.

In this way, object can be seen as finite state automaton, also called FSM - Finite State Machine.

... i call FSM implemented as object an FSO - Finite State Object.

In FSO, each of possible states can be represented graphically as a dot labelled with its list of 0's and 1's ... and methods are arrows leading from one state to one or more other states. Obviously not every state must be connected with every other possible state. Not every method must change object's state as well ... there's no arrow associated with this method then.


Context.

We can select a group of objects and contain it in another object, then states of contained objects are parts of grouping object's state. Anything outside connected to grouping object can be named 'context' / pl: kontekst /. That is ... context is 'external state'.


Mind States.

I think and feel that buddhism's concept of Mind can be explained as similar to Finite State Machine(s).

For more details, feel free to look: [ Self-Improvement and Mind States ].

No comments:

Post a Comment