Overview | Package | Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--neosim.implementation.NeosimEntityImpl
Constructor Summary | |
NeosimEntityImpl(EntityClass ec,
Population p,
int index)
Make an entity of population p, class ec, handle h |
Method Summary | |
ConnectionID | addInConnection(Connection c)
Add an input connection |
PortID | addInPort(EventClass ec)
Add an input port |
void | addOutConnection(PortID outport,
Time delay,
EntityHandle dest,
PortID destinport)
Add an output connection from an output port to a given dest |
PortID | addOutPort(EventClass ec)
Add an output port |
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,
EntityHandle 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 |
EventClass | getClassOfInPort(PortID pid)
Return the class of events accepted by an input port |
EventClass | getClassOfOutPort(PortID pid)
Return the class of events produced by an output port |
EntityClass | getEntityClass()
|
EventList | getEventList()
Get EventList |
EntityHandle | getHandle()
|
java.util.Vector | getInConnections(PortID inport)
Return the input connections to a port |
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. |
EntityHandle | lookupEntity(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,
EntityHandle e,
EntityQuery eq,
Callback c)
Query another entity at a given time |
void | queryOutputConnections(Time t,
PortID p,
ConnectionQuery cq,
Callback cb)
|
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(PortID c,
Event e)
This method sends an event on output port c. |
void | sendEvent(EntityHandle deste,
PortID destp,
Event e)
This method sends an event to input port p of entity e. |
void | setHandle(EntityHandle 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 | trace(java.lang.String msg)
|
void | updateEntity(Time t,
EntityHandle 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, notifyAll, notify, toString, wait, wait, wait |
Constructor Detail |
public NeosimEntityImpl(EntityClass ec, Population p, int index)
Method Detail |
public void init(Population p, int index)
public Time handleEvents(EventList el, Time t)
el
- The (possible empty) event list in time stamp order
t
- The time to advance topublic 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(EntityHandle deste, PortID destp, Event e)
c
- The output port to send the event from.
deste
- The destination entity
destp
- The destination input port
e
- 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 EntityHandle getHandle()
public final void setHandle(EntityHandle 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 EntityHandle lookupEntity(Time t, java.lang.String name)
t
- The time of the request
name
- The fully qualified name of the entitypublic final Population lookupPopulation(Time t, java.lang.String name)
t
- The time of the request
name
- 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 build
c
- 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 destroy
c
- 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 make
c
- 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 destroy
c
- the callback to call when the population has been destroyedpublic final void updateEntity(Time t, EntityHandle e, EntityUpdate eu, Callback c)
t
- the time to update the entity ( must be >= localTime() + getMinOutputDelay())
e
- the handle of the entity to update
eu
- the update to perform
c
- the callback to call when the update has been donepublic final void queryEntity(Time t, EntityHandle e, EntityQuery eq, Callback c)
t
- the time to query the entity ( must be >= localTime() + getMinOutputDelay())
e
- the handle of the entity to query
eq
- the query to perform
c
- 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 update
eu
- the update to perform
c
- 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 query
eq
- the query to perform
c
- 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)
public final PortID addOutPort(EventClass ec)
ec
- the class of events the port generatespublic final PortID addInPort(EventClass ec)
ec
- the class of events the port acceptspublic final EventClass getClassOfInPort(PortID pid)
pid
- the input port idpublic final EventClass getClassOfOutPort(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, EntityHandle dest, PortID destinport)
outport
- the output port id
delay
- the delay on the connection
dest
- the destination entity
destinport
- the destination port idpublic final void deleteOutConnection(PortID outport, EntityHandle 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 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)
Overview | Package | Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |