Package com.anylogic.engine.markup
- 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
- Method Details
- java.lang.Object
- com.anylogic.engine.markup.AbstractMarkup
- com.anylogic.engine.markup.MarkupShape
- com.anylogic.engine.markup.AbstractLevelMarkup
- com.anylogic.engine.markup.ServiceBase<S,
- All Implemented Interfaces:
AggregatableAnimationElement
,HasLevel
,LevelElement
,LevelMarkup
,SVGElement
,Serializable
- Direct Known Subclasses:
ServiceWArea
,ServiceWLine
public abstract class ServiceBase<S extends ServiceUnit<Q>,Q extends QueueUnit> extends AbstractLevelMarkup
- See Also:
- Serialized Form
Modifier and Type | Method | Description |
---|---|---|
void | addService |
Adds a service point to the service.
|
boolean | contains |
Always returns
false |
Q | getClosestQueue |
Returns the queue that is the closest to the service, no matter whether it is empty or not.
|
Q | getClosestQueueNotEmpty |
Returns the non-empty queue that is the closest to the service element.
|
Q | getLongestQueue |
Returns the queue containing the maximum number of pedestrians.
|
List<Agent> | getPeds |
Returns the list of agents (pedestrians) staying in the given queue
|
abstract List<Q> | getQueues() |
Returns the list of all queues of this service
|
Color | getServiceColor() |
Returns the color of the service
|
List<S> | getServices() |
Returns the list of all service points in this service
|
Q | getShortestQueue |
Returns the queue containing the least number of pedestrians.
|
boolean | isServiceSuspended |
Returns true if the service unit is in suspended state; returns false otherwise.
|
void | onDestroy() | |
void | postInitialize() |
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. |
int | queueSize |
Returns the number of agents (pedestrians) staying in the given queue
|
void | setDataSource | |
void | setServiceColor |
Sets the color of the service
|
void | setServiceSuspended |
Sets the service unit to suspended state if the suspended value is true;
sets the service unit to active state otherwise.
|
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
@AnyLogicInternalAPI public void setDataSource(ServiceDataSource<Q> dataSource)
public Color getServiceColor()
Returns the color of the service
- Returns:
- the color of the service
public void setServiceColor(Color serviceColor)
Sets the color of the service
- Parameters:
serviceColor
- new color
public void addService(S s)
Adds a service point to the service. The service should be uninitialized
- Parameters:
s
- service point
public List<S> getServices()
Returns the list of all service points in this service
- Returns:
- the list of all service points in this service
public abstract List<Q> getQueues()
Returns the list of all queues of this service
- Returns:
- the list of all queues of this service
public boolean contains(double px, double py)
Always returns
false
- 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 void postInitialize()
Description copied from interface:
AggregatableAnimationElement
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
it may be removed/renamed in future.
@AnyLogicInternalCodegenAPI public void onDestroy()
public int queueSize(Q queue)
Returns the number of agents (pedestrians) staying in the given queue
- Parameters:
queue
- the queue- Returns:
- the number of peds in the queue
public List<Agent> getPeds(Q queue)
Returns the list of agents (pedestrians) staying in the given queue
- Parameters:
queue
- the queue- Returns:
- the list of peds in the queue
public Q getClosestQueue(ServiceUnit<Q> serviceUnit)
Returns the queue that is the closest to the service, no matter whether it is empty or not.
- Parameters:
serviceUnit
- service point- Returns:
- the queue that is closest to the service
public Q getClosestQueueNotEmpty(ServiceUnit<Q> serviceUnit)
Returns the non-empty queue that is the closest to the service element.
- Parameters:
serviceUnit
- service point- Returns:
- closest non-empty queue
public Q getShortestQueue(Agent agent)
Returns the queue containing the least number of pedestrians.
- Parameters:
agent
- the agent- Returns:
- the queue containing the least number of pedestrians.
public Q getLongestQueue(ServiceUnit<Q> serviceUnit)
Returns the queue containing the maximum number of pedestrians.
- Parameters:
serviceUnit
- service point- Returns:
- the queue containing the maximum number of pedestrians.
public boolean isServiceSuspended(ServiceUnit<Q> serviceUnit)
Returns true if the service unit is in suspended state; returns false otherwise.
A suspended element is inactive and does not accept pedestrians.
- Parameters:
serviceUnit
- the service unit- Returns:
- true if the service unit is in suspended state; returns false otherwise
public void setServiceSuspended(ServiceUnit<Q> serviceUnit, boolean suspended)
Sets the service unit to suspended state if the suspended value is true;
sets the service unit to active state otherwise.
- Parameters:
serviceUnit
- the service unitsuspended
- the suspended value