Network Dynamics
Basically, a SNTOOL-AN has four main states:
- Initialization: in this phase all page instances
(following an instantion tree) and initial objects are created. This happens
only once.
- Evaluation: all agents (active objects) propose
possible actions. These actions involve other objects present in the
network (in other places or even in the same place, depending on the
configuration of the links). To each proposed action the agent assigns a
utility value and an access mode to each object present in the action.
- Perform: after all action are analysed by the engine
solver, a subset of the original set of actions is reached. This set, called
final solution is effectively executed.
- Finalization: in this phase all page instances and
remaining objects are finalized. This happens only once.
Actions can be thought as proposals that, depending on the
result of competition with other agents, represent intentions to perform a given
activity. They are the underlying mechanism by which agents realize the dynamics
in ANs. Each action has a utility value that describes the interest an agent has
in firing and an access mode to each input object (objects indicated in the
action by the requester agent). An access mode describes the type of interaction
is proposed by the agent. There are three basic types of access
modes:
- Action.SHARED: more than one agent can access the
object. None of the agents can remove the object from its origin place,
although concurrent accesses are possible.
- Action.EXCLUSIVE: only the winner (the agent with the
highest utility) can access this object. The agent cannot remove the object
from its origin place
- Action.CONSUMPTION: only the winner (the agent with
the highest utility) can access this object. The consumed object will be
removed from its origin place. If the removed object is not stored in
another place or internal state it will finalized by the Java garbage
collector (as any other Java object)
An AN model is composed by a collection of classes and pages.
Each AN class is mapped to a Java class. There are two types of AN classes:
- Internal: These are the genuine AN classes (follow the
formal model), and may contain sensors, effectors, states and functions.
- External: Allows the use the any* external Java class
inside the SNTOOL simulation engine as if it was a genuine AN class. In this
case the user must provide the class FQN (fully qualified name) and the code
generator will create another class that adapts this class to the system
requirements.
The SNTOOL Code Generator creates a stub Java class for each
class specified in the designer. There are three basic types of methods which
are of particular interest to the user. Generally, they are, considering a field
(sensor, effector, or internal state) named X of type
XType:
Method
| Description
| S
| IS
| E |
void put_X(XType v) |
Stores v in field X |
- |
X |
X |
XType get_X() |
Gets a reference to the content of field X |
X |
X |
X |
XType release_X() |
Removes the content the field and returns it X |
X |
X |
- |
void access_X(int aMode) |
Specify the access mode for the object comming through sensor
X |
X |
- |
- |
int access_X() |
Returns the access mode specified for the object comming through
sensor X |
X |
- |
- |
Method
| Description |
void setUtility(double u) |
Specify the utility
for the current proposed
action
|