|
Boeing Simulation 3.1 API Specification | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--objects.WhatWhere
|
+--objects.MovableWhatWhere
|
+--worldsimulator.SocketSimulatorComponentTemplate
|
+--worldsimulator.SimulatorSchool
A simulated bus that randomly selects a location to move towards
and then reselects another random one upon arrival. This
implementation is designed to interact with the ComponentizedSimulator.
| Field Summary | |
private boolean |
destroyed
Flag indicating whether this school is destroyed. |
private objects.Location |
goal
The location that this school will move towards. |
private Long |
id
The unique ID used to distinguish this school from another school. |
private boolean |
initialUpdate
|
protected static objects.Dimension |
SCHOOL_DIMENSIONS
The default dimensions of this object. |
protected static double |
SCHOOL_MOVEMENT_DISTANCE
The unit square distance a school is allowed to travel in one period. |
protected static long |
SCHOOL_STEP_COST
The time in milliseconds in which at step method can start and finish its execution. |
protected static long |
SCHOOL_UPDATE_PERIOD
The delay in milliseconds between the start of the periodic run method calls. |
private static long |
serialVersionUID
|
private boolean |
targeted
Flag indicatiing whether this school is targeted. |
| Fields inherited from class worldsimulator.SocketSimulatorComponentTemplate |
simulatorConnection, simulatorQueue |
| Fields inherited from class objects.WhatWhere |
dim, loc |
| Constructor Summary | |
SimulatorSchool(connect.CreatesConnection toSimulator)
|
|
SimulatorSchool(objects.Location loc,
connect.CreatesConnection toSimulator)
|
|
SimulatorSchool(objects.Location loc,
objects.Location goal,
connect.CreatesConnection toSimulator)
|
|
| Method Summary | |
boolean |
accept(Class requestingType)
Returns true if the requesting component is allowed to control the actions of this school. |
protected boolean |
allowMethod(util.MethodRequest request)
Returns true if this object accepts the method being invoked upon itself. |
void |
connect(connect.CreatesConnection host)
This method should not be called in the current implementaiton |
void |
destroy()
Marks this school as being destroyed and stops all movement. |
boolean |
equals(Object other)
Returns true if the object is a SimulatorSchool and has the same ID value. |
long |
getID()
Returns the ID of this object. |
protected long |
getStepCost()
Returns the time interval in milliseconds in which the step function may be called and return. |
protected long |
getUpdatePeriod()
Returns the time in milliseconds between subsequent calls of the periodic step function. |
int |
hashCode()
Returns the hash code based on its ID. |
boolean |
isDestroyed()
Returns whether this object has been destroyed. |
boolean |
isTargeted()
Returns whether this object is currently targeted. |
protected void |
processIncomingConnection(Class hostType,
connect.ChannelBundle bundle)
Handles the bevahior of this component when another component initiates the connection to this component. |
protected void |
processOutgoingConnection(Class hostType,
connect.ChannelBundle bundle)
Handles the bevahior of this component when it initiates a connection to a remote component |
void |
setAsTargeted()
Marks this object as targeted. |
void |
setAsUntargeted()
Marks this object as untargeted. |
void |
step()
Moves the school one update distance towards its current gaol, then notifies the ComponentizedSimulator of its
progress. |
String |
toString()
|
| Methods inherited from class worldsimulator.SocketSimulatorComponentTemplate |
debug, getComponentEmissary, getConnection, getObject, getOverrunLogic, isStarted, run, startPeriodicMovements, stopPeriodicRun |
| Methods inherited from class objects.MovableWhatWhere |
setLoc, setLoc |
| Methods inherited from class objects.WhatWhere |
bound, getCenter, getDimensions, getDistance, getHeight, getLoc, getWidth, isEastOf, isNorthOf, isSouthOf, isWestOf, overlaps |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface objects.Locatable |
getDistance, getLoc, isEastOf, isNorthOf, isSouthOf, isWestOf |
| Field Detail |
private static final long serialVersionUID
protected static final objects.Dimension SCHOOL_DIMENSIONS
protected static final long SCHOOL_UPDATE_PERIOD
protected static final long SCHOOL_STEP_COST
protected static final double SCHOOL_MOVEMENT_DISTANCE
private boolean destroyed
private objects.Location goal
private final Long id
private boolean targeted
private boolean initialUpdate
| Constructor Detail |
public SimulatorSchool(objects.Location loc,
objects.Location goal,
connect.CreatesConnection toSimulator)
public SimulatorSchool(objects.Location loc,
connect.CreatesConnection toSimulator)
public SimulatorSchool(connect.CreatesConnection toSimulator)
| Method Detail |
public boolean accept(Class requestingType)
accept in class SocketSimulatorComponentTemplateprotected boolean allowMethod(util.MethodRequest request)
SocketSimulatorComponentTemplate
allowMethod in class SocketSimulatorComponentTemplatepublic void connect(connect.CreatesConnection host)
connect in interface Componentconnect in class SocketSimulatorComponentTemplateSocketComponentTemplate.allowMethod(util.MethodRequest)public void destroy()
destroy in interface Destroyablepublic boolean equals(Object other)
, where n is the total number of
SimulatorSchool objects.
- Specified by:
equals in class SocketSimulatorComponentTemplate
public long getID()
protected long getStepCost()
SocketSimulatorComponentTemplate
getStepCost in class SocketSimulatorComponentTemplateSocketSimulatorComponentTemplate.step()protected long getUpdatePeriod()
SocketSimulatorComponentTemplate
getUpdatePeriod in class SocketSimulatorComponentTemplateSocketSimulatorComponentTemplate.step()public int hashCode()
hashCode in class SocketSimulatorComponentTemplatepublic boolean isDestroyed()
Destroyable
isDestroyed in interface Destroyablepublic boolean isTargeted()
Targetable
isTargeted in interface Targetable
protected void processOutgoingConnection(Class hostType,
connect.ChannelBundle bundle)
SocketSimulatorComponentTemplate
processOutgoingConnection in class SocketSimulatorComponentTemplateSocketSimulatorComponentTemplate.connect(connect.CreatesConnection)
protected void processIncomingConnection(Class hostType,
connect.ChannelBundle bundle)
SocketSimulatorComponentTemplate
processIncomingConnection in class SocketSimulatorComponentTemplateSocketSimulatorComponentTemplate.connect(connect.CreatesConnection)public void step()
ComponentizedSimulator of its
progress. If the school reaches its goal, then it begins moving
randomly
step in class SocketSimulatorComponentTemplateSocketSimulatorComponentTemplate.run()public void setAsTargeted()
Targetable
setAsTargeted in interface Targetablepublic void setAsUntargeted()
Targetable
setAsUntargeted in interface Targetablepublic String toString()
toString in class Object
|
Boeing Simulation 3.1 API Specification | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||