Package jsl.modeling.elements.spatial
Interface MoverIfc
-
- All Superinterfaces:
GetNameIfc
,IdentityIfc
,PositionIfc
,SpatialElementIfc
,VelocityIfc
- All Known Implementing Classes:
AbstractMover
,AbstractRG2DMover
,MobileResource
,Mover
,RandomMover
,RG2DMover
,Transporter
public interface MoverIfc extends SpatialElementIfc, VelocityIfc
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
cancelTrip()
If the mover is on a trip then the movement along the trip is canceled and the mover stays at the position where it is when this method is called.CollisionDetectorIfc
getCollisionDetector()
CollisionHandlerIfc
getCollisionHandler()
CoordinateIfc
getDestination()
Gets a reference to the CoordinateIfc representing the destination of the moverCoordinateIfc
getFuturePosition(double time)
Returns a CoordinateIfc that represents the future position of the spatial element at the given time.MovementControllerIfc
getMovementController()
double
getMovementDistance()
Gets the distance associated with the current movementdouble
getMovementStartTime()
Get the time that the current movement starteddouble
getMovementTime()
Gets the time length for the current movementdouble
getMovementVelocity()
Gets the velocity of the movement that is in progressOutsideSpatialModelHandlerIfc
getOSMHandler()
Get the object the handles when the movement takes the element outside the boundaries of the current spatial modeldouble
getVelocity()
boolean
isMoving()
Indicates whether or not the element is currently movingboolean
isOnTrip()
Indicates whether or not the element is currently on a tripvoid
setCollisionDetector(CollisionDetectorIfc collisionDetector)
Sets the collision detector.void
setCollisionHandler(CollisionHandlerIfc collisionHandler)
Sets the collision handler, if null then no collision handling is performedvoid
setMovement(double velocity, CoordinateIfc position)
Sets up the movement before it gets processed.void
setMovementController(MovementControllerIfc movementController)
Set the movement controller.void
setOSMHandler(OutsideSpatialModelHandlerIfc OSMHandler)
Set the handler for taking care of when the element goes outside the boundaries of its spatial model.void
setVelocityInitialRandomSource(RandomIfc source)
Sets the random source associated with the velocity used at the beginning of each replicationvoid
setVelocityRandomSource(RandomIfc source)
Sets the random source associated with the velocity.-
Methods inherited from interface jsl.utilities.GetNameIfc
getName
-
Methods inherited from interface jsl.utilities.IdentityIfc
getId
-
Methods inherited from interface jsl.modeling.elements.spatial.SpatialElementIfc
attachPositionObserver, changeSpatialModel, distanceTo, distanceTo, getInitialPosition, getInitialSpatialModel, getModelElement, getObserverState, getPosition, getPreviousPosition, getSpatialModel, initializeSpatialElement, isPositionEqualTo, isPositionEqualTo, removePositionObserver, setInitialPosition
-
Methods inherited from interface jsl.modeling.elements.spatial.VelocityIfc
getVelocityChangeFactor, getVelocityInitialRandomSource, getVelocityRandomSource, setVelocityChangeFactor
-
-
-
-
Method Detail
-
getFuturePosition
CoordinateIfc getFuturePosition(double time)
Returns a CoordinateIfc that represents the future position of the spatial element at the given time.- Parameters:
time
- Must be greater than or equal to zero- Returns:
- the coordinate of the future position
-
isMoving
boolean isMoving()
Indicates whether or not the element is currently moving- Returns:
- true if moving
-
isOnTrip
boolean isOnTrip()
Indicates whether or not the element is currently on a trip- Returns:
- true if on a trip
-
getMovementDistance
double getMovementDistance()
Gets the distance associated with the current movement- Returns:
- Returns the movementDistance.
-
getMovementTime
double getMovementTime()
Gets the time length for the current movement- Returns:
- Returns the movementTime
-
getMovementStartTime
double getMovementStartTime()
Get the time that the current movement started- Returns:
- Returns the movementStartTime.
-
getMovementVelocity
double getMovementVelocity()
Gets the velocity of the movement that is in progress- Returns:
- Returns the movementVelocity.
-
getDestination
CoordinateIfc getDestination()
Gets a reference to the CoordinateIfc representing the destination of the mover- Returns:
- the CoordinateIfcIfc for this element
-
getCollisionDetector
CollisionDetectorIfc getCollisionDetector()
- Returns:
- Returns the collisionDetector.
-
setCollisionDetector
void setCollisionDetector(CollisionDetectorIfc collisionDetector)
Sets the collision detector. If null no detection is used- Parameters:
collisionDetector
- The collisionDetector to set.
-
getCollisionHandler
CollisionHandlerIfc getCollisionHandler()
- Returns:
- Returns the collisionHandler.
-
setCollisionHandler
void setCollisionHandler(CollisionHandlerIfc collisionHandler)
Sets the collision handler, if null then no collision handling is performed- Parameters:
collisionHandler
- The collisionHandler to set.
-
getMovementController
MovementControllerIfc getMovementController()
- Returns:
- Returns the movementController.
-
setMovementController
void setMovementController(MovementControllerIfc movementController)
Set the movement controller. If null, then the default movement uses the point to point distance at velocity 1.- Parameters:
movementController
- The movementController to set.
-
getVelocity
double getVelocity()
- Specified by:
getVelocity
in interfaceVelocityIfc
- Returns:
- a value from the velocity random source
-
setVelocityInitialRandomSource
void setVelocityInitialRandomSource(RandomIfc source)
Sets the random source associated with the velocity used at the beginning of each replication- Specified by:
setVelocityInitialRandomSource
in interfaceVelocityIfc
- Parameters:
source
- the source of the randomness
-
setVelocityRandomSource
void setVelocityRandomSource(RandomIfc source)
Sets the random source associated with the velocity. This is reset at the beginning of each replication to the value set with setVelocityInitialRandomSource()- Specified by:
setVelocityRandomSource
in interfaceVelocityIfc
- Parameters:
source
- the source of the randomness
-
getOSMHandler
OutsideSpatialModelHandlerIfc getOSMHandler()
Get the object the handles when the movement takes the element outside the boundaries of the current spatial model- Returns:
- Returns the OSMHandler.
-
cancelTrip
void cancelTrip()
If the mover is on a trip then the movement along the trip is canceled and the mover stays at the position where it is when this method is called. This method cancels movement. If the mover is not moving or on a trip nothing happens.
-
setOSMHandler
void setOSMHandler(OutsideSpatialModelHandlerIfc OSMHandler)
Set the handler for taking care of when the element goes outside the boundaries of its spatial model. If null, then an exception will be thrown if the element tries to go outside its spatial element.- Parameters:
OSMHandler
- The OSMHandler to set.
-
setMovement
void setMovement(double velocity, CoordinateIfc position)
Sets up the movement before it gets processed. Takes in a velocity for the movement (which must be > 0) and the coordinate where the movement should end. This method should be used by MovementControllers to set the movement characteristics prior to the move. This method sets: 1) the velocity of the move 2) the distance of the move 3) the direction of the move 4) the time the move starts 5) the total time to move to the position at the given velocity- Parameters:
velocity
- Must be > 0position
- Must not be null
-
-