Package com.anylogic.engine.markup
- Nested Class Summary
- Constructor Summary
- Method Summary
- Methods inherited from class com.anylogic.engine.markup.AbstractLevelMarkup
- Methods inherited from class com.anylogic.engine.markup.MarkupShape
- Methods inherited from class com.anylogic.engine.markup.AbstractMarkup
- Methods inherited from class java.lang.Object
- Methods inherited from interface com.anylogic.engine.markup.AggregatableAnimationElement
- Methods inherited from interface com.anylogic.engine.markup.pedestrian.IElevatorDescriptor
- Constructor Details
- Method Details
- getX
- setX
- getY
- setY
- getXYZ
- setXYZ
- getCabinZ
- getWidth
- getWidth
- setWidth
- setWidth
- getDepth
- getDepth
- setDepth
- setDepth
- getRotation
- setRotation
- setWallColor
- getWallColor
- getWallTexture
- setPlatformColor
- getPlatformColor
- getPlatformTexture
- getLinePaint
- getFillPaint
- getCapacity
- accessibleLevels
- getDoorsConfiguration
- addAccessibleLevels
- getLibraryDescriptor
- addToLevels
- getShafts
- setMarkup
- getMarkup
- contains
- getBoundingRectangle
- getMovementMode
- getSpeed
- getSpeed
- getTimePerLevel
- getTimePerLevel
- getCabinHeight
- setCabinHeight
- getLineWidth
- setLineWidth
- setDoorsConfiguration
- minStayTime
- minStayTime
- isAllLevels
- setCapacity
- setMovementMode
- setSpeed
- setSpeed
- setTimePerLevel
- setTimePerLevel
- setAllLevels
- isDrawShaft
- setDrawShaft
- getState
- getPeds
- getCurrentDirection
- getCurrentLevel
- getCalls
- getRoute
- getWaitingPeds
- getWaitingPeds
- disableDoor
- enableDoor
- isDoorEnabled
- fail
- repair
- isFailed
- onArrival
- onDeparture
- onFailed
- onRepaired
- resetStats
- timeInState
- timeInState
- utilization
- totalTravelTime
- totalTravelTime
- meanWaitingTime
- meanWaitingTime
- meanWaitingTime
- meanWaitingTime
- nPickedUpPeds
- nDroppedOffPeds
- nTransportedPeds
- setManualMode
- isManualMode
- moveTo
- moveTo
- pickUpPeds
- dropOffPeds
- getTargetLevel
- deleteCallsOnLevel
- onStateChanged
- getPedTargetLevel
- getNearestLevel
- isShaftsInitialized_xjal
- java.lang.Object
- com.anylogic.engine.markup.AbstractMarkup
- com.anylogic.engine.markup.MarkupShape
- com.anylogic.engine.markup.AbstractLevelMarkup
- com.anylogic.engine.markup.Elevator<A>
- All Implemented Interfaces:
AggregatableAnimationElement
,HasLevel
,IMarkupLibraryDescriptor
,LevelElement
,LevelMarkup
,IElevatorDescriptor<A>
,SVGElement
,Serializable
public class Elevator<A extends Agent> extends AbstractLevelMarkup implements IElevatorDescriptor<A>
- See Also:
- Serialized Form
Modifier and Type | Class | Description |
---|---|---|
static interface | Elevator.Call<T extends Agent> |
Class describing elevator call at certain level
|
Constructor | Description |
---|---|
Elevator() | |
Elevator |
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. It is public due to technical reasons. |
Modifier and Type | Method | Description |
---|---|---|
Level[] | accessibleLevels() |
Returns array of levels, which can be served by elevator
|
void | addAccessibleLevels |
Adds levels that can be served by elevator.
|
void | addToLevels() |
Used when elevator markup is created by code - adds elevator to all its
levels as an obstacle and adds shafts.
|
boolean | contains |
Test if the shape contains the point with the given coordinates (relative
to this shape's container, i.e.
|
void | deleteCallsOnLevel |
Removes all pickup tasks from the level.
|
void | disableDoor |
Disables elevator door on the level.
|
void | dropOffPeds |
Starts drop off for the pedestrians in the list.
|
void | enableDoor |
Enables elevator door on the level.
|
void | fail() |
Initiates the elevator's failure.
|
BoundingRectangle | getBoundingRectangle() | |
double | getCabinHeight |
Returns elevator cabin height
|
double | getCabinZ() | |
List<? extends Elevator.Call<A>> | getCalls() |
Returns list of elevator calls
|
int | getCapacity() |
Returns the number of pedestrian elevator can transfer at once
|
ElevatorDirection | getCurrentDirection() |
Returns current movement direction of the elevator.
|
Level | getCurrentLevel() |
Returns elevator current level.
|
double | getDepth() |
Returns the depth of the markup shape, in meters.
|
double | getDepth |
Returns the depth of the markup shape.
|
ElevatorDoorsConfiguration | getDoorsConfiguration() |
Returns elevator doors configuration.
|
Paint | getFillPaint() | |
IElevatorDescriptor<A> | getLibraryDescriptor() | |
Paint | getLinePaint() | |
double | getLineWidth() |
Returns elevator line width (in pixels)
|
Elevator<A> | getMarkup() | |
ElevatorMovementMode | getMovementMode() |
Returns elevator movement mode.
|
Level | getNearestLevel() |
Returns nearest level level - current level if elevator is not between
levels, next level along direction if elevator is moving and closest
otherwise.
|
Set<A> | getPeds() |
Returns the list of pedestrians that are currently inside elevator
|
Level | getPedTargetLevel |
Returns target level of a pedestrian, specified in PedElevator block.
|
Color | getPlatformColor() |
Returns the platform color of the elevator markup, or
null if
markup element has no platform color or has textured platform (in this case
getPlatformTexture() should be used instead) |
Texture | getPlatformTexture() |
Returns the platform texture of the elevator markup, or
null if
markup element has no platform texture (in this case
getPlatformColor() should be used instead) |
double | getRotation() |
Returns the rotation of the shape.
|
List<Level> | getRoute() |
Returns the list of levels which the elevator is going to visit according to current tasks.
|
List<ElevatorShaft> | getShafts() | |
double | getSpeed() |
Returns elevator speed.
|
double | getSpeed |
Returns elevator speed
|
ElevatorState | getState() |
Returns current elevator state
|
Level | getTargetLevel() |
Returns target level when the elevator is in manual mode and moving,
null otherwise. |
double | getTimePerLevel() |
Returns time to move between two neighboring levels
|
double | getTimePerLevel |
Returns time to move between two neighboring levels
|
Set<A> | getWaitingPeds() |
Returns set of pedestrians waiting for elevator on all levels
|
Set<A> | getWaitingPeds |
Returns set of pedestrians waiting for elevator on the level
|
Color | getWallColor() |
Returns the wall color of the elevator markup, or
null if markup
element has no wall color or has textured wall (in this case
getWallTexture() should be used instead) |
Texture | getWallTexture() |
Returns the wall texture of the elevator markup, or
null if
markup element has no wall texture (in this case getWallColor()
should be used instead) |
double | getWidth() |
Returns the width of the markup shape, in meters.
|
double | getWidth |
Returns the width of the markup shape.
|
double | getX() |
Returns the x coordinate of the markup element.
|
Point | getXYZ() |
Returns coordinates of the markup element.
|
double | getY() |
Returns the y coordinate of the markup element.
|
boolean | isAllLevels() |
Returns
true if elevator supposed to serve all levels in owner
agent, false otherwise |
boolean | isDoorEnabled |
Returns
true if the door on the level is enabled, false
otherwise. |
boolean | isDrawShaft() |
Returns
true if the elevator's shaft is drawn, otherwise returns
false . |
boolean | isFailed() |
Returns
true if the elevator failed (broke down) and is not
operating, otherwise returns false . |
boolean | isManualMode() |
Returns
true if the elevator is in manual mode, false
otherwise. |
boolean | isShaftsInitialized_xjal() | |
double | meanWaitingTime() |
Returns mean time (in model time units) pedestrian spent waiting for elevator
on all levels
|
double | meanWaitingTime |
Returns mean time (in model time units) pedestrian spent waiting for elevator
on specified level
|
double | meanWaitingTime |
Returns mean time (in units) pedestrian spent waiting for elevator on
specified level
|
double | meanWaitingTime |
Returns mean time (in units) pedestrian spent waiting for elevator on all
levels
|
double | minStayTime() |
Returns minimum time elevator will spend on the level before moving further.
|
double | minStayTime |
Returns minimum time elevator will spend on the level before moving further.
|
void | moveTo |
Sends the elevator to specified level.
|
void | moveTo |
Sends the elevator to specified level.
|
int | nDroppedOffPeds |
Returns number of pedestrians elevator dropped off at specified level
|
int | nPickedUpPeds |
Returns number of pedestrians elevator picked up at specified level
|
int | nTransportedPeds() |
Returns number of pedestrians transported by the elevator
|
void | onArrival |
Calls
onArrival() code of the elevator |
void | onDeparture |
Calls
onDeparture() code of the elevator |
void | onFailed() |
Calls
onFailed() code of the elevator |
void | onRepaired() |
Calls
onRepaired() code of the elevator |
void | onStateChanged |
Calls
onStateChanged() code of the elevator. |
void | pickUpPeds |
Starts pickup for the pedestrians in the list.
|
void | repair() |
Repairs the elevator.
|
void | resetStats() |
Resets all elevator statistics.
|
void | setAllLevels |
Sets whether elevator should serve all levels in owner agent
|
void | setCabinHeight |
Sets elevator cabin height
|
void | setCapacity |
Sets elevator capacity
|
void | setDepth |
Sets the depth of the markup shape.
|
void | setDepth |
Sets the depth of the markup shape.
|
void | setDoorsConfiguration |
Sets elevator doors configuration.
|
void | setDrawShaft |
Sets whether elevator's shaft should be drawn.
|
void | setLineWidth |
Sets elevator line width (in pixels)
|
void | setManualMode |
Changes current mode of the elevator.
|
void | setMarkup | |
void | setMovementMode |
Sets elevator movement mode.
|
void | setPlatformColor |
Sets the platform color (or
Texture ) of the elevator markup. |
void | setRotation |
Sets the rotation of the shape.
|
void | setSpeed |
Sets elevator speed.
|
void | setSpeed |
Sets elevator speed.
|
void | setTimePerLevel |
Sets elevator time per level.
|
void | setTimePerLevel |
Sets time per level.
|
void | setWallColor |
Sets the wall color (or
Texture ) of the elevator markup. |
void | setWidth |
Sets the width of the markup shape.
|
void | setWidth |
Sets the width of the markup shape.
|
void | setX |
Sets the x coordinate of the markup element.
|
void | setXYZ |
Sets coordinates of the markup element.
|
void | setY |
Sets the y coordinate of the markup element.
|
double | timeInState |
Returns time (in model time units) elevator spent in specified state since
model start or since last
resetStats() call |
double | timeInState |
Returns time (in units) elevator spent in specified state since model start
or since last
resetStats() call |
double | totalTravelTime() |
Returns total time (in model time units) elevator was moving since model
start or since last
resetStats() call |
double | totalTravelTime |
Returns total time (in units) elevator was moving since model start or since
last
resetStats() call |
double | utilization() |
Returns the elevator utilization: the fraction of time the elevator was
operating.
|
error, getFullName, getOutsideLevelZ, getPresentable, getSpace, initialize, isClickHandled, isPublic, onClick, remove, setDrawMode, setOwner
discardOwner, executeUserAction, findSVGElement, getName, getSVGId, initializeInternal, isVisible, onAggregatorInitialized, onAggregatorVisibilityChanged, removeSVGFromOwner, resetSVGState, setVisible, updateDynamicProperties, updateDynamicPropertiesStructural, updateSVGProperties
public Elevator()
@AnyLogicInternalCodegenAPI public Elevator(Agent owner, ShapeDrawMode drawMode, boolean isPublic, double x, double y, double widthInMeters, double depthInMeters, double cabinHeightInMeters, double lineWidth, double rotation, Paint lineColor, Paint fillColor, boolean drawShaft, ElevatorDoorsConfiguration doorsConfiguration, IElevatorDescriptor<A> descriptor)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. It is public due to technical reasons.
it may be removed/renamed in future. It is public due to technical reasons.
public double getX()
Returns the x coordinate of the markup element.
- Returns:
- the x coordinate of the markup element
public void setX(double x)
Sets the x coordinate of the markup element.
- Parameters:
x
- the new value of x coordinate
public double getY()
Returns the y coordinate of the markup element.
- Returns:
- the y coordinate of the markup element
public void setY(double y)
Sets the y coordinate of the markup element.
- Parameters:
y
- the new value of y coordinate
public Point getXYZ()
Returns coordinates of the markup element.
- Returns:
- coordinates of the markup element
public void setXYZ(double x, double y, double z)
Sets coordinates of the markup element.
- Parameters:
x
- the new value of x coordinatey
- the new value of y coordinatez
- the new value of z coordinate
public double getCabinZ()
- Specified by:
getCabinZ
in interfaceIElevatorDescriptor<A extends Agent>
public double getWidth(LengthUnits units)
Returns the width of the markup shape.
- Returns:
- the width of the markup shape
public double getWidth()
Returns the width of the markup shape, in meters.
- Returns:
- the width of the markup shape, in meters
public void setWidth(double width, LengthUnits units)
Sets the width of the markup shape.
- Parameters:
width
- the new width of the markup shapeunits
- the units of length
public void setWidth(double width)
Sets the width of the markup shape.
- Parameters:
width
- the new width of the markup shape, in meters
public double getDepth(LengthUnits units)
Returns the depth of the markup shape.
- Returns:
- the depth of the markup shape
public double getDepth()
Returns the depth of the markup shape, in meters.
- Returns:
- the depth of the markup shape, in meters
public void setDepth(double depth, LengthUnits units)
Sets the depth of the markup shape.
- Parameters:
depth
- the new depth of the markup shapeunits
- the units of length
public void setDepth(double depth)
Sets the depth of the markup shape.
- Parameters:
depth
- the new depth of the markup shape, in meters
public double getRotation()
Returns the rotation of the shape.
- Returns:
- the rotation of the shape in radians, clockwise
public void setRotation(double rotation)
Sets the rotation of the shape.
- Parameters:
r
- the new value of rotation in radians
public void setWallColor(Paint wallColor)
Sets the wall color (or
Texture
) of the elevator markup.- Parameters:
wallColor
- the new wall color, null = do not draw the elevator walls
public Color getWallColor()
Returns the wall color of the elevator markup, or
null
if markup
element has no wall color or has textured wall (in this case
getWallTexture()
should be used instead)- Returns:
- the wall color of the elevator markup
public Texture getWallTexture()
Returns the wall texture of the elevator markup, or
null
if
markup element has no wall texture (in this case getWallColor()
should be used instead)- Returns:
- the wall texture of the elevator markup
public void setPlatformColor(Paint platformColor)
Sets the platform color (or
Texture
) of the elevator markup.- Parameters:
platformColor
- the new platform color, null = do not draw the platform of the elevator markup.
public Color getPlatformColor()
Returns the platform color of the elevator markup, or
null
if
markup element has no platform color or has textured platform (in this case
getPlatformTexture()
should be used instead)- Returns:
- the platform color of the elevator markup
public Texture getPlatformTexture()
Returns the platform texture of the elevator markup, or
null
if
markup element has no platform texture (in this case
getPlatformColor()
should be used instead)- Returns:
- the platform texture of the elevator markup
@AnyLogicInternalAPI public Paint getLinePaint()
@AnyLogicInternalAPI public Paint getFillPaint()
public int getCapacity()
Returns the number of pedestrian elevator can transfer at once
- Specified by:
getCapacity
in interfaceIElevatorDescriptor<A extends Agent>
- Returns:
- the number of pedestrian elevator can transfer at once
public Level[] accessibleLevels()
Returns array of levels, which can be served by elevator
- Specified by:
accessibleLevels
in interfaceIElevatorDescriptor<A extends Agent>
- Returns:
- array of levels, which can be served by elevator
public ElevatorDoorsConfiguration getDoorsConfiguration()
Returns elevator doors configuration.
- Returns:
- elevator doors configuration. Valid values are:
ELEVATOR_DOORS_FRONT
ELEVATOR_DOORS_FRONT_REAR
public void addAccessibleLevels(Level... levels)
Adds levels that can be served by elevator. Previously added levels will not
be removed. Automatically changes "Stops at" to "selected levels"
- Specified by:
addAccessibleLevels
in interfaceIElevatorDescriptor<A extends Agent>
- Parameters:
levels
- - array of levels to add
@AnyLogicInternalAPI public IElevatorDescriptor<A> getLibraryDescriptor()
public void addToLevels()
Used when elevator markup is created by code - adds elevator to all its
levels as an obstacle and adds shafts. Should be used after all elevator
parameters are set.
@AnyLogicInternalAPI public List<ElevatorShaft> getShafts()
@AnyLogicInternalAPI public void setMarkup(Elevator<A> markup)
- Specified by:
setMarkup
in interfaceIElevatorDescriptor<A extends Agent>
@AnyLogicInternalAPI public Elevator<A> getMarkup()
public boolean contains(double px, double py)
Description copied from class:
MarkupShape
Test if the shape contains the point with the given coordinates (relative
to this shape's container, i.e. in the same system with the coordinates
of this shape, x and y)
- Specified by:
contains
in classMarkupShape
- Parameters:
px
- the x coordinate relative to this shape's containerpy
- the y coordinate relative to this shape's container- Returns:
true
if the shape contains the point with the given coordinates
@AnyLogicInternalAPI public BoundingRectangle getBoundingRectangle()
public ElevatorMovementMode getMovementMode()
Returns elevator movement mode.
- Specified by:
getMovementMode
in interfaceIElevatorDescriptor<A extends Agent>
- Returns:
- movement mode. Valid values are:
ELEVATOR_MOVEMENT_BY_SPEED
ELEVATOR_MOVEMENT_BY_TIME_PER_LEVEL
public double getSpeed()
Returns elevator speed.
- Specified by:
getSpeed
in interfaceIElevatorDescriptor<A extends Agent>
- Returns:
- elevator speed, in meters per second
public double getSpeed(SpeedUnits units)
Returns elevator speed
- Parameters:
units
- - speed units for returned value- Returns:
- elevator speed, in provided units
public double getTimePerLevel()
Returns time to move between two neighboring levels
- Specified by:
getTimePerLevel
in interfaceIElevatorDescriptor<A extends Agent>
- Returns:
- time to move between two neighboring levels, in seconds
public double getTimePerLevel(TimeUnits units)
Returns time to move between two neighboring levels
- Parameters:
units
- - time units for returned value- Returns:
- time to move between two neighboring levels, in units
public double getCabinHeight(LengthUnits units)
Returns elevator cabin height
- Parameters:
units
- the units of cabin height- Returns:
- elevator cabin height
public void setCabinHeight(double cabinHeight, LengthUnits units)
Sets elevator cabin height
- Parameters:
cabinHeight
- the new elevator cabin heightunits
- the units of cabin height
public double getLineWidth()
Returns elevator line width (in pixels)
- Returns:
- elevator line width (in pixels)
public void setLineWidth(double lineWidth)
Sets elevator line width (in pixels)
- Parameters:
lineWidth
- - new elevator line width (in pixels)
public void setDoorsConfiguration(ElevatorDoorsConfiguration doorsConfiguration)
Sets elevator doors configuration.
- Parameters:
doorsConfiguration
- - doors configuration. Valid values are:ELEVATOR_DOORS_FRONT
ELEVATOR_DOORS_FRONT_REAR
public double minStayTime()
Returns minimum time elevator will spend on the level before moving further.
If loading is not finished after this time, elevator will depart immediately
after the loading finished.
- Specified by:
minStayTime
in interfaceIElevatorDescriptor<A extends Agent>
- Returns:
- minimum stay time, in seconds
public double minStayTime(TimeUnits units)
Returns minimum time elevator will spend on the level before moving further.
If loading is not finished after this time, elevator will depart immediately
after the loading finished.
- Parameters:
units
- - time units for returned value- Returns:
- minimum stay time, in units
public boolean isAllLevels()
Returns
true
if elevator supposed to serve all levels in owner
agent, false
otherwise- Specified by:
isAllLevels
in interfaceIElevatorDescriptor<A extends Agent>
- Returns:
true
if elevator supposed to serve all levels in owner agent,false
otherwise
public void setCapacity(int capacity)
Sets elevator capacity
- Specified by:
setCapacity
in interfaceIElevatorDescriptor<A extends Agent>
- Parameters:
capacity
- - number of pedestrian elevator can transfer at once
public void setMovementMode(ElevatorMovementMode movementMode)
Sets elevator movement mode.
- Specified by:
setMovementMode
in interfaceIElevatorDescriptor<A extends Agent>
- Parameters:
movementMode
- . Valid values are:ELEVATOR_MOVEMENT_BY_SPEED
ELEVATOR_MOVEMENT_BY_TIME_PER_LEVEL
public void setSpeed(double speed)
Sets elevator speed.
- Specified by:
setSpeed
in interfaceIElevatorDescriptor<A extends Agent>
- Parameters:
speed
- - new elevator speed, in meters per second
public void setSpeed(double speed, SpeedUnits units)
Sets elevator speed.
- Parameters:
speed
- - new elevator speed, in unitsunits
- - the units of speed
public void setTimePerLevel(double timePerLevel)
Sets elevator time per level.
- Specified by:
setTimePerLevel
in interfaceIElevatorDescriptor<A extends Agent>
- Parameters:
timePerLevel
- - new time per level, in seconds
public void setTimePerLevel(double timePerLevel, TimeUnits units)
Sets time per level.
- Parameters:
speed
- - new time per level, in unitsunits
- - time units
public void setAllLevels(boolean allLevels)
Sets whether elevator should serve all levels in owner agent
- Specified by:
setAllLevels
in interfaceIElevatorDescriptor<A extends Agent>
- Parameters:
allLevels
- -true
if elevator supposed to serve all levels in owner agent,false
if levels specified manually byaddAccessibleLevels()
method
public boolean isDrawShaft()
Returns
true
if the elevator's shaft is drawn, otherwise returns
false
.- Returns:
true
if the elevator's shaft is drawn, otherwise returnsfalse
.
public void setDrawShaft(boolean drawShaft)
Sets whether elevator's shaft should be drawn.
- Parameters:
drawShaft
- -true
if elevator's shaft should be drawn,false
otherwise
public ElevatorState getState()
Returns current elevator state
- Specified by:
getState
in interfaceIElevatorDescriptor<A extends Agent>
- Returns:
- current elevator state. Valid values are:
ELEVATOR_STATE_IDLE
ELEVATOR_STATE_LOADING
ELEVATOR_STATE_MOVING
ELEVATOR_STATE_FAILED
public Set<A> getPeds()
Returns the list of pedestrians that are currently inside elevator
- Specified by:
getPeds
in interfaceIElevatorDescriptor<A extends Agent>
- Returns:
- the list of pedestrians that are currently inside elevator
public ElevatorDirection getCurrentDirection()
Returns current movement direction of the elevator. If elevator is not
moving, but has movement tasks (to pickup or drop off passengers), return
direction of the next task. If there are no tasks for elevator, returns
ELEVATOR_DIRECTION_NONE
- Specified by:
getCurrentDirection
in interfaceIElevatorDescriptor<A extends Agent>
- Returns:
- current movement direction of the elevator. Valid values are:
ELEVATOR_DIRECTION_UP
ELEVATOR_DIRECTION_DOWN
ELEVATOR_DIRECTION_NONE
public Level getCurrentLevel()
Returns elevator current level. If elevator is between levels, returns lower
level.
- Specified by:
getCurrentLevel
in interfaceIElevatorDescriptor<A extends Agent>
- Returns:
- elevator current level. If elevator is between levels, returns lower level.
public List<? extends Elevator.Call<A>> getCalls()
Returns list of elevator calls
- Specified by:
getCalls
in interfaceIElevatorDescriptor<A extends Agent>
- Returns:
List<Call>
- list of elevator calls
public List<Level> getRoute()
Returns the list of levels which the elevator is going to visit according to current tasks.
Levels are ordered according to elevator order of visits.
- Specified by:
getRoute
in interfaceIElevatorDescriptor<A extends Agent>
- Returns:
- the list of levels which the elevator is going to visit
public Set<A> getWaitingPeds(Level level)
Returns set of pedestrians waiting for elevator on the level
- Specified by:
getWaitingPeds
in interfaceIElevatorDescriptor<A extends Agent>
- Returns:
Set<Agent>
waiting for elevator on the level
public Set<A> getWaitingPeds()
Returns set of pedestrians waiting for elevator on all levels
- Specified by:
getWaitingPeds
in interfaceIElevatorDescriptor<A extends Agent>
- Returns:
Set<Agent>
waiting for elevator on all levels
public void disableDoor(Level level, ElevatorDoor door)
Disables elevator door on the level. Overrides initial doors configuration.
- Specified by:
disableDoor
in interfaceIElevatorDescriptor<A extends Agent>
- Parameters:
level
- the level where door should be disableddoor
- the door which should be disabled. valid values are:ELEVATOR_DOOR_FRONT
ELEVATOR_DOOR_REAR
public void enableDoor(Level level, ElevatorDoor door)
Enables elevator door on the level. Overrides initial doors configuration.
- Specified by:
enableDoor
in interfaceIElevatorDescriptor<A extends Agent>
- Parameters:
level
- the level where door should be enableddoor
- the door which should be enabled. Valid values are:ELEVATOR_DOOR_FRONT
ELEVATOR_DOOR_REAR
public boolean isDoorEnabled(Level level, ElevatorDoor door)
Returns
true
if the door on the level is enabled, false
otherwise. Door state is defined by initial doors configuration and by
enableDoor(com.anylogic.engine.markup.Level,com.anylogic.engine.markup.ElevatorDoor)
, disableDoor(com.anylogic.engine.markup.Level,com.anylogic.engine.markup.ElevatorDoor)
functions- Specified by:
isDoorEnabled
in interfaceIElevatorDescriptor<A extends Agent>
- Parameters:
level
- the leveldoor
- the door to check. Valid values are:ELEVATOR_DOOR_FRONT
ELEVATOR_DOOR_REAR
public void fail()
Initiates the elevator's failure. The elevator stops working.
- Specified by:
fail
in interfaceIElevatorDescriptor<A extends Agent>
public void repair()
Repairs the elevator. The elevator becomes available again.
- Specified by:
repair
in interfaceIElevatorDescriptor<A extends Agent>
public boolean isFailed()
Returns
true
if the elevator failed (broke down) and is not
operating, otherwise returns false
.- Specified by:
isFailed
in interfaceIElevatorDescriptor<A extends Agent>
- Returns:
true
if the elevator failed andfalse
otherwise
public void onArrival(Level level, List<A> waitingPeds)
Calls
onArrival()
code of the elevator- Specified by:
onArrival
in interfaceIElevatorDescriptor<A extends Agent>
- Parameters:
level
- - arrival levelwaitingPeds
- - pedestrians waiting for pickup on arrival level
public void onDeparture(Level level)
Calls
onDeparture()
code of the elevator- Specified by:
onDeparture
in interfaceIElevatorDescriptor<A extends Agent>
- Parameters:
level
- - current level of the elevator
public void onFailed()
Calls
onFailed()
code of the elevator- Specified by:
onFailed
in interfaceIElevatorDescriptor<A extends Agent>
public void onRepaired()
Calls
onRepaired()
code of the elevator- Specified by:
onRepaired
in interfaceIElevatorDescriptor<A extends Agent>
public void resetStats()
Resets all elevator statistics.
- Specified by:
resetStats
in interfaceIElevatorDescriptor<A extends Agent>
public double timeInState(ElevatorState state, TimeUnits units)
Returns time (in units) elevator spent in specified state since model start
or since last
resetStats()
call- Specified by:
timeInState
in interfaceIElevatorDescriptor<A extends Agent>
- Parameters:
state
- - elevator state. Valid values are:ELEVATOR_STATE_IDLE
ELEVATOR_STATE_LOADING
ELEVATOR_STATE_MOVING
ELEVATOR_STATE_FAILED
units
- - time units for returned value- Returns:
- time elevator spent in specified state
public double timeInState(ElevatorState state)
Returns time (in model time units) elevator spent in specified state since
model start or since last
resetStats()
call- Specified by:
timeInState
in interfaceIElevatorDescriptor<A extends Agent>
- Parameters:
state
- - elevator state. Valid values are:ELEVATOR_STATE_IDLE
ELEVATOR_STATE_LOADING
ELEVATOR_STATE_MOVING
ELEVATOR_STATE_FAILED
- Returns:
- time elevator spent in specified state, in model time units
public double utilization()
Returns the elevator utilization: the fraction of time the elevator was
operating. The returned elevator utilization value lies in the range [0..1].
- Specified by:
utilization
in interfaceIElevatorDescriptor<A extends Agent>
public double totalTravelTime(TimeUnits units)
Returns total time (in units) elevator was moving since model start or since
last
resetStats()
call- Specified by:
totalTravelTime
in interfaceIElevatorDescriptor<A extends Agent>
- Parameters:
units
- - time units for returned value- Returns:
- total movement time
public double totalTravelTime()
Returns total time (in model time units) elevator was moving since model
start or since last
resetStats()
call- Specified by:
totalTravelTime
in interfaceIElevatorDescriptor<A extends Agent>
- Returns:
- total movement time, in model time units
public double meanWaitingTime(TimeUnits units)
Returns mean time (in units) pedestrian spent waiting for elevator on all
levels
- Specified by:
meanWaitingTime
in interfaceIElevatorDescriptor<A extends Agent>
- Parameters:
units
- - time units for returned value- Returns:
- mean time (in units) pedestrian spent waiting for elevator on all levels
public double meanWaitingTime()
Returns mean time (in model time units) pedestrian spent waiting for elevator
on all levels
- Specified by:
meanWaitingTime
in interfaceIElevatorDescriptor<A extends Agent>
- Returns:
- mean time pedestrian spent waiting for elevator on all levels, in model time units
public double meanWaitingTime(Level level, TimeUnits units)
Returns mean time (in units) pedestrian spent waiting for elevator on
specified level
- Specified by:
meanWaitingTime
in interfaceIElevatorDescriptor<A extends Agent>
- Parameters:
units
- - time units for returned value- Returns:
- mean time (in units) pedestrian spent waiting for elevator on specified level
public double meanWaitingTime(Level level)
Returns mean time (in model time units) pedestrian spent waiting for elevator
on specified level
- Specified by:
meanWaitingTime
in interfaceIElevatorDescriptor<A extends Agent>
- Returns:
- mean time pedestrian spent waiting for elevator on specified level, in model time units
public int nPickedUpPeds(Level level)
Returns number of pedestrians elevator picked up at specified level
- Specified by:
nPickedUpPeds
in interfaceIElevatorDescriptor<A extends Agent>
- Parameters:
level
- - level served by the elevator- Returns:
- number of pedestrians elevator picked up at specified level
public int nDroppedOffPeds(Level level)
Returns number of pedestrians elevator dropped off at specified level
- Specified by:
nDroppedOffPeds
in interfaceIElevatorDescriptor<A extends Agent>
- Parameters:
level
- - level served by the elevator- Returns:
- number of pedestrians elevator dropped off at specified level
public int nTransportedPeds()
Returns number of pedestrians transported by the elevator
- Specified by:
nTransportedPeds
in interfaceIElevatorDescriptor<A extends Agent>
- Returns:
- number of pedestrians transported by the elevator
public void setManualMode(boolean on)
Changes current mode of the elevator. When manual mode is on, elevator will
move, pickup and dropoff pedestrians only according to
moveTo()
,
dropOffPeds()
calls.- Specified by:
setManualMode
in interfaceIElevatorDescriptor<A extends Agent>
- Parameters:
on
- -true
for turn manual mode on,false
otherwise
public boolean isManualMode()
Returns
true
if the elevator is in manual mode, false
otherwise.- Specified by:
isManualMode
in interfaceIElevatorDescriptor<A extends Agent>
- Returns:
true
if the elevator is in manual mode,false
otherwise.
public void moveTo(Level level, boolean stayInManualMode)
Sends the elevator to specified level. If elevator is in loading state, all
pedestrians planned for pick up or drop off will be processed first.
Automatically turns on manual mode.
- Specified by:
moveTo
in interfaceIElevatorDescriptor<A extends Agent>
- Parameters:
level
- - target levelstayInManualMode
- - iftrue
, elevator will stay in manual mode after reaching targte level. Iffalse
, elevator will switch to auto mode on arrival, and will continue to operate.
public void moveTo(Level level)
Sends the elevator to specified level. If elevator is in loading state, all
pedestrians planned for pick up or drop off will be processed first.
Automatically turns on manual mode. On arrival to target level will stay in
manual mode.
- Parameters:
level
- - target level
public void pickUpPeds(Collection<? extends Agent> peds)
Starts pickup for the pedestrians in the list. Works only in manual mode. All
pedestrians should be on the same level where elevator currently is. Throws
error if the elevator is between levels or a pedestrian is not on the same
level with the elevator.
- Specified by:
pickUpPeds
in interfaceIElevatorDescriptor<A extends Agent>
public void dropOffPeds(Collection<? extends Agent> peds)
Starts drop off for the pedestrians in the list. Works only in manual mode.
All pedestrians should be inside the elevator. Pedestrians will appear on the
level where the elevator is located.
- Specified by:
dropOffPeds
in interfaceIElevatorDescriptor<A extends Agent>
public Level getTargetLevel()
Returns target level when the elevator is in manual mode and moving,
null
otherwise.- Specified by:
getTargetLevel
in interfaceIElevatorDescriptor<A extends Agent>
- Returns:
- target level when the elevator is in manual mode and moving,
null
otherwise.
public void deleteCallsOnLevel(Level level)
Removes all pickup tasks from the level. Pedestrian will be still waiting for
the elevator, use
cancel()
or remove()
to handle them.- Specified by:
deleteCallsOnLevel
in interfaceIElevatorDescriptor<A extends Agent>
- Parameters:
level
- - level on which all pickup tasks will be removed.
public void onStateChanged(ElevatorState newState)
Calls
onStateChanged()
code of the elevator.- Specified by:
onStateChanged
in interfaceIElevatorDescriptor<A extends Agent>
public Level getPedTargetLevel(Agent ped)
Returns target level of a pedestrian, specified in PedElevator block. If not
defined, returns
null
- Specified by:
getPedTargetLevel
in interfaceIElevatorDescriptor<A extends Agent>
- Parameters:
ped
- - pedestrian for which target level will be returned.- Returns:
- target level of a pedestrian, specified in PedElevator block. If not
defined, returns
null
public Level getNearestLevel()
Returns nearest level level - current level if elevator is not between
levels, next level along direction if elevator is moving and closest
otherwise.
- Specified by:
getNearestLevel
in interfaceIElevatorDescriptor<A extends Agent>
@AnyLogicInternalAPI public boolean isShaftsInitialized_xjal()