|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--neosim.implementation.EntityImpl
Constructor Summary | |
EntityImpl(EntityClass ec,
Population p,
int index)
Make an entity of population p, class ec |
Method Summary | |
ConnectionID |
addInConnection(Connection c)
Add an input connection |
PortID |
addInPort(EventClass ec)
Add an input port |
PortID |
addInPort(java.util.Vector vec)
Add an input port |
void |
addOutConnection(PortID outport,
Time delay,
EntityID dest,
PortID destinport)
Add an output connection from an output port to a given dest |
PortID |
addOutPort(EventClass ec)
Add an output port |
PortID |
addOutPort(java.util.Vector vec)
Add an output port |
int |
compareTo(java.lang.Object o)
Compare two "Entity" objects based on Right Window Times |
void |
connect(Time t,
Projection p,
Callback c)
Make connections at a given time |
void |
construct(Time t,
PopulationBuilder p,
Callback c)
Build a population at a given time |
void |
defaultEventHandler(Event e)
This method deals with built in events, used for querying and updating entity state. |
void |
deleteInConnection(ConnectionID cid)
Delete an input connection |
void |
deleteInPort(PortID inport)
Delete an input port |
void |
deleteOutConnection(PortID outport,
EntityID dest,
PortID destinport)
|
void |
deleteOutPort(PortID outport)
Delete an output port |
void |
destroy()
This method is called when the entity is deleted. |
void |
destroy(Time t,
Population p,
Callback c)
Destroy a population at a given time. |
void |
disconnect(Time t,
Projection p,
Callback c)
Delete connections at a given time |
java.util.Vector |
getClassesOfInPort(PortID pid)
Return the classes of events accepted by an input port |
java.util.Vector |
getClassesOfOutPort(PortID pid)
Return the classes of events produced by an output port |
EntityClass |
getEntityClass()
|
EventList |
getEventList()
Get EventList |
EntityID |
getID()
|
java.util.Vector |
getInConnections(PortID inport)
Return the input connections to a port |
int |
getIndex()
|
Time |
getLocalTime()
Get the current local time |
Time |
getMinOutputDelay()
Get the minimum output delay |
java.lang.String |
getName()
|
NeosimClasses |
getNeosimClasses()
Return the set of user defined classes. |
int |
getNumInConnections(PortID inport)
Return the number of input connections on a port |
int |
getNumInPorts()
|
int |
getNumOutConnections(PortID outport)
Return the number of output connections from a port |
int |
getNumOutPorts()
|
neosim.kernel.OutPortTable |
getOutConnection(PortID outport)
|
Population |
getPopulation()
|
PopulationTree |
getPopulationTree(Time t)
Return the top level population tree. |
Time |
getRightWindowTime()
Get the right window time |
Time |
handleEvents(EventList el,
Time t)
User entities MUST extend this method : deal with events in el up to time t, and advance the entity's time to at least t and return the time actually advanced to (which may be later than t, as long as the state can be rewound back to t and no new events are generated after t). |
void |
init(Population p,
int index)
User entities can extend this method |
EntityClass |
lookupEntityClass(java.lang.String name)
Look up an EntityClass object given a name, e.g. |
EntityID |
lookupEntityID(Time t,
java.lang.String name)
Look up an Entity handle given a name, e.g. |
Population |
lookupPopulation(Time t,
java.lang.String name)
Look up a Population given a name, e.g. |
void |
postEvent(Event e)
Post event, connection id is coded in event. |
void |
queryEntity(Time t,
EntityID e,
EntityQuery eq,
Callback c)
Query another entity at a given time |
void |
queryOutputConnections(Time t,
PortID p,
ConnectionQuery cq,
Callback cb)
Query output connections of a port |
void |
queryPopulation(Time t,
Population p,
EntityQuery eq,
Callback c)
Query a population of entities at a given time |
void |
reset()
This method is called when simulation time is rest to zero. |
void |
resetOutputDelay()
Set output delay to its previous value |
void |
sendEvent(EntityID deste,
PortID destp,
Event e)
This method sends an event to input port p of entity e. |
void |
sendEvent(PortID c,
Event e)
This method sends an event on output port c. |
void |
setDstConnectionParams(Connection c,
ConnectionID destcid,
java.util.Hashtable params)
Set additional connection parameters at dst end Called by ParamConnectionSpec.setDstParams User entities should override this to set their connection params |
void |
setID(EntityID h)
Sets the handle of this entity. |
void |
setLocalTime(Time t)
Set the current local time |
void |
setMinOutputDelay(Time t)
Set the minimum output delay |
void |
setProvLocalTime(Time t)
Set the provisional local time |
void |
setSrcConnectionParams(Connection c,
PortID srcpid,
java.util.Hashtable params)
Set additional connection parameters at src end Called by ParamConnectionSpec.setSrcParams User entities should override this to set their connection params |
void |
trace(java.lang.String msg)
Write a trace message |
void |
updateEntity(Time t,
EntityID e,
EntityUpdate eu,
Callback c)
Update another entity at a given time |
void |
updatePopulation(Time t,
Population p,
EntityUpdate eu,
Callback c)
Update a population of entities at a given time |
void |
zeroOutputDelay()
Zero delay on system output port |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public EntityImpl(EntityClass ec, Population p, int index)
Method Detail |
public void init(Population p, int index)
public int getIndex()
public Time handleEvents(EventList el, Time t)
el
- The (possible empty) event list in time stamp ordert
- The time to advance todefaultEventHandler(neosim.iface.Event)
public void reset()
public void destroy()
public final void sendEvent(PortID c, Event e)
c
- The output port to send the event to.e
- The event to send. Its timestamp should
be the sending timepublic final void sendEvent(EntityID deste, PortID destp, Event e)
c
- The output port to send the event from.deste
- The destination entitydestp
- The destination input porte
- The event to send. Its timestamp should
be the sending timepublic final void defaultEventHandler(Event e)
e
- The event to handlepublic final Population getPopulation()
public final EntityClass getEntityClass()
public final EntityID getID()
public final void setID(EntityID h)
h
- the new handlepublic final java.lang.String getName()
public final PopulationTree getPopulationTree(Time t)
t
- the time of the request (needed as the population tree
changes with time)public final NeosimClasses getNeosimClasses()
public final EntityClass lookupEntityClass(java.lang.String name)
name
- The fully qualified name of the classpublic final EntityID lookupEntityID(Time t, java.lang.String name)
t
- The time of the requestname
- The fully qualified name of the entitypublic final Population lookupPopulation(Time t, java.lang.String name)
t
- The time of the requestname
- The fully qualified name of the populationpublic final void construct(Time t, PopulationBuilder p, Callback c)
t
- the time to build the population ( must be >= localTime() + getMinOutputDelay())p
- the population to buildc
- the callback to call when the population has been built.public final void destroy(Time t, Population p, Callback c)
t
- the time to build the population ( must be >= localTime() + getMinOutputDelay())p
- the population to destroyc
- the callback to call when the population has been destroyedpublic final void connect(Time t, Projection p, Callback c)
t
- the time to make the connections ( must be >= localTime() + getMinOutputDelay())p
- the projection to makec
- the callback to call when the connections have been madepublic final void disconnect(Time t, Projection p, Callback c)
t
- the time to delete the connections ( must be >= localTime() + getMinOutputDelay())p
- the population to destroyc
- the callback to call when the population has been destroyedpublic final void updateEntity(Time t, EntityID e, EntityUpdate eu, Callback c)
t
- the time to update the entity ( must be >= localTime() + getMinOutputDelay())e
- the handle of the entity to updateeu
- the update to performc
- the callback to call when the update has been donepublic final void queryEntity(Time t, EntityID e, EntityQuery eq, Callback c)
t
- the time to query the entity ( must be >= localTime() + getMinOutputDelay())e
- the handle of the entity to queryeq
- the query to performc
- the callback to call with the results of the querypublic final void updatePopulation(Time t, Population p, EntityUpdate eu, Callback c)
t
- the time to update the entity ( must be >= localTime() + getMinOutputDelay())p
- the population to updateeu
- the update to performc
- the callback to call when the update has been donepublic final void queryPopulation(Time t, Population p, EntityQuery eq, Callback c)
t
- the time to query the population( must be >= localTime() + getMinOutputDelay())p
- the population to queryeq
- the query to performc
- the callback to call with the results of the query. The results will
be in the form of a vector of objects, indexed by entties' index in the population.public final void queryOutputConnections(Time t, PortID p, ConnectionQuery cq, Callback cb)
t
- the time to query the connections( must be >= localTime() + getMinOutputDelay())p
- the output portcq
- the query to run on each output connectionc
- the callback to call with the results of the query. The results will
be in the form of a vector of objects, ordered by entity handle/input connection id.public final PortID addOutPort(EventClass ec)
ec
- the class of events the port generatespublic final PortID addOutPort(java.util.Vector vec)
ec
- the class of events the port generatespublic final PortID addInPort(EventClass ec)
ec
- the class of events the port acceptspublic final PortID addInPort(java.util.Vector vec)
ec
- the class of events the port acceptspublic final java.util.Vector getClassesOfInPort(PortID pid)
pid
- the input port idpublic final java.util.Vector getClassesOfOutPort(PortID pid)
pid
- the output port idpublic final int getNumInConnections(PortID inport)
inport
- the input port idpublic final int getNumOutConnections(PortID outport)
outport
- the output port idpublic final neosim.kernel.OutPortTable getOutConnection(PortID outport)
public final int getNumOutPorts()
public final int getNumInPorts()
public final java.util.Vector getInConnections(PortID inport)
outport
- the output port idpublic final void addOutConnection(PortID outport, Time delay, EntityID dest, PortID destinport)
outport
- the output port iddelay
- the delay on the connectiondest
- the destination entitydestinport
- the destination port idpublic final void deleteOutConnection(PortID outport, EntityID dest, PortID destinport)
public final ConnectionID addInConnection(Connection c)
c
- the input connection to addpublic final void deleteInConnection(ConnectionID cid)
cid
- the input connection to deletepublic void setSrcConnectionParams(Connection c, PortID srcpid, java.util.Hashtable params)
params
- the table of name/value (strings)public void setDstConnectionParams(Connection c, ConnectionID destcid, java.util.Hashtable params)
params
- the table of name/value (strings)public final void deleteInPort(PortID inport)
inport
- the input port idpublic final void deleteOutPort(PortID outport)
inport
- the input port idpublic final void zeroOutputDelay()
public void resetOutputDelay()
public Time getMinOutputDelay()
public void setMinOutputDelay(Time t)
public Time getLocalTime()
public void setLocalTime(Time t)
public void setProvLocalTime(Time t)
public Time getRightWindowTime()
public EventList getEventList()
public void postEvent(Event e)
public void trace(java.lang.String msg)
public int compareTo(java.lang.Object o) throws java.lang.ClassCastException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |