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 Detail
- java.lang.Object
-
- com.anylogic.engine.markup.AbstractMarkup
-
- com.anylogic.engine.markup.MarkupShape
-
- com.anylogic.engine.markup.AbstractLevelMarkup
-
- com.anylogic.engine.markup.ServiceBase<S,Q>
- All Implemented Interfaces:
AggregatableAnimationElement
,HasLevel
,LevelElement
,LevelMarkup
,SVGElement
,java.io.Serializable
- Direct Known Subclasses:
ServiceWArea
,ServiceWLine
public abstract class ServiceBase<S extends ServiceUnit<Q>,Q extends QueueUnit> extends AbstractLevelMarkup
- See Also:
- Serialized Form
void |
addService(S s) |
Adds a service point to the service.
|
boolean |
contains(double px,
double py) |
Always returns
false |
Q |
getClosestQueue(ServiceUnit<Q> serviceUnit) |
Returns the queue that is the closest to the service, no matter whether it is empty or not.
|
Q |
getClosestQueueNotEmpty(ServiceUnit<Q> serviceUnit) |
Returns the non-empty queue that is the closest to the service element.
|
Q |
getLongestQueue(ServiceUnit<Q> serviceUnit) |
Returns the queue containing the maximum number of pedestrians.
|
java.util.List<Agent> |
getPeds(Q queue) |
Returns the list of agents (pedestrians) staying in the given queue
|
abstract java.util.List<Q> |
getQueues() |
Returns the list of all queues of this service
|
java.awt.Color |
getServiceColor() |
Returns the color of the service
|
java.util.List<S> |
getServices() |
Returns the list of all service points in this service
|
Q |
getShortestQueue(Agent agent) |
Returns the queue containing the least number of pedestrians.
|
boolean |
isServiceSuspended(ServiceUnit<Q> serviceUnit) |
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(Q queue) |
Returns the number of agents (pedestrians) staying in the given queue
|
void |
setDataSource(ServiceDataSource<Q> dataSource) |
|
void |
setServiceColor(java.awt.Color serviceColor) |
Sets the color of the service
|
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.
|
Modifier and Type | Method | Description |
---|
getDrawMode, getLevel, setLevel
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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initializeInternal, onAggregatorVisibilityChanged
@AnyLogicInternalAPI public void setDataSource(ServiceDataSource<Q> dataSource)
public java.awt.Color getServiceColor()
Returns the color of the service
- Returns:
- the color of the service
public void setServiceColor(java.awt.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 java.util.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 java.util.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 java.util.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
-
How can we improve this article?
-