|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvisidia.misc.property.PropertyTable
visidia.simulation.process.agent.Agent
public abstract class Agent
This is the abstract base class representing an agent in visidia. It is the API to be used to implement new agents (extending Agent class).
Field Summary | |
---|---|
protected AgentMover |
agentMover
The agent mover. |
protected AgentProcess |
proc
The process. |
Constructor Summary | |
---|---|
protected |
Agent()
Instantiates a new agent. |
Method Summary | |
---|---|
protected java.util.Collection |
agentsOnVertex()
Returns the collection of agents which are on the destination vertex of current agent. |
abstract java.lang.Object |
clone()
|
protected int |
entryDoor()
Returns the door from which the agent comes. |
int |
getArity()
Gets the arity. |
Vertex |
getDestinationVertex()
Gets the destination vertex. |
protected java.lang.Object |
getEdgeProperty(int door,
java.lang.Object key)
Gets the edge property value. |
protected int |
getNetSize()
Gets the net size. |
java.lang.Object |
getProperty(java.lang.Object key)
Returns the property value associated with the key. |
protected int |
getVertexIdentity()
Gets the identity of vertex on which the agent is located. |
protected java.lang.String |
getVertexLabel()
Gets the vertex label. |
protected java.lang.Object |
getVertexProperty(java.lang.Object key)
Gets the vertex property value. |
protected abstract void |
init()
Initializes the agent. |
protected boolean |
lockVertexIfPossible()
If the vertex is already locked, return false and does nothing, else return true and lock the vertex. |
protected void |
lockVertexProperties()
Lock vertex properties. |
protected void |
move()
Moves the agent. |
protected void |
moveBack()
Moves the agent back to the vertex from where it comes. |
protected void |
moveToDoor(int door)
Moves agent to door. |
void |
run()
|
protected void |
setAgentMover(java.lang.String name)
Sets the agent mover. |
void |
setAgentProcess(AgentProcess proc)
Sets the agent process. |
protected void |
setDoorState(EdgeState st,
int door)
Sets the door state. |
protected void |
setEdgeProperty(int door,
java.lang.Object key,
java.lang.Object value)
Sets the edge property. |
java.lang.Object |
setProperty(java.lang.Object key,
java.lang.Object value)
Sets the property. |
java.lang.Object |
setProperty(java.lang.Object key,
java.lang.Object value,
int status)
Sets the property (key, value). |
protected void |
setVertexLabel(java.lang.String label)
Sets the vertex label. |
protected void |
setVertexProperty(java.lang.Object key,
java.lang.Object value)
Sets the vertex property. |
protected void |
setVertexProperty(java.lang.Object key,
java.lang.Object value,
int status)
Sets the vertex property. |
protected void |
sleep(int milliseconds)
Use this method if you want to fall asleep for a given amount of milliseconds. |
java.lang.String |
toString()
|
protected void |
unlockVertexProperties()
Unlock vertex properties. |
protected boolean |
vertexPropertiesLocked()
Return true if the Vertex is locked, otherwise false. |
Methods inherited from class visidia.misc.property.PropertyTable |
---|
containsElement, entrySet, getLockOwner, getPropertyKeys, getVisidiaProperty, isPersistentProperty, locked, lockProperties, removeProperty, resetProperties, setProperties, setVisidiaProperty, unlockProperties |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected transient AgentProcess proc
protected AgentMover agentMover
Constructor Detail |
---|
protected Agent()
Method Detail |
---|
public abstract java.lang.Object clone()
clone
in class PropertyTable
protected abstract void init()
protected final java.util.Collection agentsOnVertex()
public final int getArity()
protected final void sleep(int milliseconds)
milliseconds
- the number of millisecondsprotected final int getNetSize()
public final java.lang.Object getProperty(java.lang.Object key)
key
- the key
public final java.lang.Object setProperty(java.lang.Object key, java.lang.Object value, int status)
key
- the keyvalue
- the valuestatus
- the status
public final java.lang.Object setProperty(java.lang.Object key, java.lang.Object value)
key
- the keyvalue
- the value
null
if it did not have one.protected final java.lang.Object getVertexProperty(java.lang.Object key)
key
- the key
protected final void setVertexProperty(java.lang.Object key, java.lang.Object value, int status)
key
- the keyvalue
- the valuestatus
- the statusprotected final void setVertexProperty(java.lang.Object key, java.lang.Object value)
key
- the keyvalue
- the valueprotected final int getVertexIdentity()
protected final java.lang.String getVertexLabel()
protected final void setVertexLabel(java.lang.String label)
label
- the new vertex labelprotected final void lockVertexProperties()
protected final void unlockVertexProperties()
protected final boolean vertexPropertiesLocked()
lockVertexProperties()
protected final boolean lockVertexIfPossible()
protected final java.lang.Object getEdgeProperty(int door, java.lang.Object key)
door
- the doorkey
- the key
protected final void setEdgeProperty(int door, java.lang.Object key, java.lang.Object value)
door
- the doorkey
- the keyvalue
- the valueprotected final void setDoorState(EdgeState st, int door)
st
- the new statedoor
- the doorprotected final void move()
protected final void moveBack()
protected final void moveToDoor(int door)
door
- the doorprotected final int entryDoor()
protected final void setAgentMover(java.lang.String name)
name
- the new agent moverpublic final Vertex getDestinationVertex()
public java.lang.String toString()
toString
in class java.lang.Object
public final void setAgentProcess(AgentProcess proc)
proc
- the new agent processpublic final void run()
run
in interface java.lang.Runnable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |