- Constructor Summary
- Method Summary
- Methods inherited from class com.anylogic.engine.markup.ConveyorMarkupElement
- 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.AnimationStaticLocationProvider
- Methods inherited from interface com.anylogic.engine.markup.material_handling.IMaterialMarkupLibraryDescriptor
- Methods inherited from interface com.anylogic.engine.markup.INetworkMarkupElement
- Methods inherited from interface com.anylogic.engine.markup.IPath
- Methods inherited from interface java.lang.Iterable
- Constructor Detail
- Method Detail
- getLibraryDescriptor
- getPositionsOnConveyor
- getStations
- getSpurs
- getSplitMerges
- createPortInternal
- createPort
- createPort
- getSource
- setSource
- getTarget
- setTarget
- getOtherNode
- setDrawStands
- isDrawStands
- setStandsLevel
- getStandsLevel
- isReversible
- setReversible
- isBidirectional
- setBidirectional
- getDirection
- setDirection
- changeDirection
- isChangingDirection
- onDirectionChanged
- getLineColor
- getLineTexture
- setLineColor
- getWidth
- setWidth
- getLineWidth
- setLineWidth
- addSegment
- getSegmentCount
- getSegment
- iterator
- length
- length
- getStartPoint
- getStartPoint
- getEndPoint
- getEndPoint
- getStartPosition
- getStartPosition
- getEndPosition
- getEndPosition
- contains
- containsSq
- getNearestPoint
- randomPointInside
- getPosition
- getPosition
- getPositionAtOffset
- getPositionAtOffset
- toString
- getType
- setType
- isAccumulating
- isStopped
- stop
- run
- getMaxSpeed
- setMaxSpeed
- getInitialSpeed
- setInitialSpeed
- getCurrentSpeed
- getCurrentAcceleration
- getAcceleration
- setAcceleration
- getDeceleration
- getCellSize
- setCellSize
- setDeceleration
- getGap
- setGap
- size
- getAgent
- getAgents
- getAgent
- getAgents
- removeAgent
- contains
- onLeadingEdgeEnter
- onTrailingEdgeEnter
- onLeadingEdgeExit
- onTrailingEdgeExit
- onStarted
- onStopped
- isFailed
- fail
- repair
- onFailed
- onRepaired
- onMotionChanged
- isMaximumPriority
- setMaximumPriority
- priority
- getBoundingRectangle
- updateDynamicProperties
- isObstacle
- setObstacle
- validate
- createPort
- createPort
- java.lang.Object
-
- com.anylogic.engine.markup.AbstractMarkup
-
- com.anylogic.engine.markup.MarkupShape
-
- com.anylogic.engine.markup.ConveyorMarkupElement<T>
-
- com.anylogic.engine.markup.ConveyorPath<T>
- All Implemented Interfaces:
AggregatableAnimationElement
,AnimationMovingLocationProvider
,AnimationStaticLocationProvider
,HasLevel
,IMarkupLibraryDescriptor
,INetworkMarkupElement
,IPath<ConveyorNode<?>>
,com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T>
,com.anylogic.engine.markup.material_handling.IMaterialAreaLocation<T>
,com.anylogic.engine.markup.material_handling.IMaterialFallible
,com.anylogic.engine.markup.material_handling.IMaterialMarkupLibraryDescriptor
,com.anylogic.engine.markup.material_handling.IMaterialPointLocation<T>
,SVGElement
,java.io.Serializable
,java.lang.Iterable<MarkupSegment>
public class ConveyorPath<T extends Agent> extends ConveyorMarkupElement<T> implements IPath<ConveyorNode<?>>, java.lang.Iterable<MarkupSegment>, com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T>
Several conveyors can be connected together. Altogether they compose a conveyor network. In the conveyor network, movement is always performed along the shortest conveyor between the origin and the destination nodes.
Conveyor starts with the defined initial speed and accelerates to the defined maximum speed, keeping it until stops.
Unlike many other space markup elements that just define the element's location and size graphically, the conveyor element also provides users with a set of actions, which are used to define additional agent behavior.
Conveyor types
By default the roller conveyor is used, but if required you can set it to be of any available type:
- Roller - It is an accumulating type of a conveyor. If an agent is stopped on it, the rollers will keep on rolling, bringing all the preceding material items to the stopped one, thus forming a line of agents. The Gap parameter defines how close the material items can be pushed to each other. If the Gap is set to 0, collisions are inevitable.
- Belt - It is not an accumulating type of a conveyor. If an agent is stopped, the whole conveyor stops to prevent collision of material items. The distance between the items is defined by the Gap parameter.
- Fixed cell - It is not an accumulating type of a conveyor. The conveyor is a succession of cells of specified size. Agents are placed in the center of the conveyor cell. One conveyor cell can contain only one material item. The Gap parameter defines the distance between the conveyor cells. If an agent is stopped, the whole conveyor stops.
- See Also:
- Serialized Form
ConveyorPath() |
|
ConveyorPath(Agent owner,
ShapeDrawMode drawMode,
boolean isPublic) |
Deprecated.
deprecated in version 8.4, will be removed in the future releases
|
ConveyorPath(Agent owner,
ShapeDrawMode drawMode,
boolean isPublic,
boolean isObstacle,
double widthInMeters,
java.awt.Paint color,
boolean drawStands,
double standsLevel,
com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T> descriptor,
ConveyorNode<?> source,
ConveyorNode<?> target,
MarkupSegment... segments) |
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. |
ConveyorPath(Agent owner,
ShapeDrawMode drawMode,
boolean isPublic,
boolean isObstacle,
double widthInMeters,
java.awt.Paint color,
boolean drawStands,
double standsLevel,
com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T> descriptor,
MarkupSegment... segments) |
Deprecated.
deprecated in version 8.4, will be removed in the future releases
|
Constructor | Description |
---|
void |
addSegment(MarkupSegment segment) |
Adds segment to this markup element
|
void |
changeDirection() |
Changes current direction of this conveyor to the opposite
|
boolean |
contains(double px,
double py) |
Test if the shape contains the point with the given coordinates (relative
to this shape's container, i.e.
|
boolean |
contains(Agent agent) |
|
boolean |
containsSq(double px,
double py,
double squareDistance) |
|
default NetworkPort |
createPort(IPath<?> path,
PathEndType endType) |
|
default NetworkPort |
createPort(IPath<?> path,
PathEndType endType,
NetworkPort pairedPort) |
|
NetworkPort |
createPort(PathEndType endType) |
Creates and returns a Network Port located on specified conveyor's end
|
NetworkPort |
createPort(PathEndType endType,
NetworkPort pairedPort) |
Creates and returns a Network Port located on specified conveyor's end and pairs created port with specified one
|
NetworkPort |
createPortInternal(PathEndType endType) |
|
void |
fail() |
Initiates conveyor failure.
|
double |
getAcceleration(AccelerationUnits units) |
Returns the acceleration of the conveyor in the specified acceleration units.
|
T |
getAgent(double offset,
LengthUnits units) |
|
T |
getAgent(int index) |
Returns the agent at a given position (counted from 0, from the exit).
|
java.util.List<T> |
getAgents() |
Returns the list of agents (material items) that are currently conveyed
|
java.util.List<T> |
getAgents(double offset,
double length,
LengthUnits units) |
|
BoundingRectangle |
getBoundingRectangle() |
|
double |
getCellSize(LengthUnits units) |
|
double |
getCurrentAcceleration(AccelerationUnits units) |
|
double |
getCurrentSpeed(SpeedUnits units) |
Returns the current speed of the conveyor in the specified speed units.
|
double |
getDeceleration(AccelerationUnits units) |
Returns the deceleration of the conveyor in the specified acceleration units.
|
ConveyorDirection |
getDirection() |
Returns the direction of this conveyor
|
Point |
getEndPoint() |
Returns the location of the end point
|
Point |
getEndPoint(Point out) |
Returns the location of the end point
|
Position |
getEndPosition() |
Returns the end position
|
Position |
getEndPosition(Position out) |
Returns the end position
|
double |
getGap(LengthUnits units) |
Returns the minimum required gap between material items of this conveyor (in the specified length units).
|
double |
getInitialSpeed(SpeedUnits units) |
Returns the initial speed of the conveyor in the specified speed units.
|
com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T> |
getLibraryDescriptor() |
|
java.awt.Color |
getLineColor() |
Returns the line color of the markup element, or
null if markup element has no line color or
has textured line (in this case IPath.getLineTexture() should be used instead) |
Texture |
getLineTexture() |
Returns the line texture of the markup element, if the markup element has line texture
|
double |
getLineWidth() |
This method is internal and shouldn't be called by user.
it may be removed in future. |
double |
getMaxSpeed(SpeedUnits units) |
Returns the maximum speed of the conveyor in the specified speed units.
|
double |
getNearestPoint(Point givenPoint,
Point out) |
Calculates (using the
output object) the point in this space markup element
nearest to the given point. |
ConveyorNode<?> |
getOtherNode(ConveyorNode<?> n) |
Returns the second (other) node of the conveyor.
|
Position |
getPosition(double value,
double maxValue,
Position out) |
Returns position with offset corresponding to the given
value ,
assuming that 0 is start and maxValue is end |
Position |
getPosition(int index,
int totalNumber,
Position out) |
Returns the item position with the given index.
In case of any wrong argument returns zero-index position (position for index=0 with totalNumber=1). |
Position |
getPositionAtOffset(double offset,
LengthUnits units,
Position out) |
Returns the point (+rotations) located on the markup element with the given
offset
distance calculated from start point. |
Position |
getPositionAtOffset(double offset,
Position out) |
Returns the point (+rotations) located on the markup element with the given
offset
distance calculated from start point. |
java.util.List<PositionOnConveyor<T>> |
getPositionsOnConveyor() |
Returns the list of all PositionOnConveyor elements on this conveyor
|
MarkupSegment |
getSegment(int index) |
Returns the segment by its index
|
int |
getSegmentCount() |
Returns the number of segments
|
ConveyorNode<?> |
getSource() |
Returns the source node of the conveyor.
|
java.util.List<ConveyorSpur<T>> |
getSplitMerges() |
Deprecated.
will be removed in the next release.
|
java.util.List<ConveyorSpur<T>> |
getSpurs() |
Returns the list of conveyor spur elements of this conveyor.
|
double |
getStandsLevel() |
Returns the base level Z-level to draw conveyor stands from.
|
Point |
getStartPoint() |
Returns the location of the start point
|
Point |
getStartPoint(Point out) |
Returns the location of the start point
|
Position |
getStartPosition() |
Returns the start position
|
Position |
getStartPosition(Position out) |
Returns the start position
|
java.util.List<ConveyorStation<T>> |
getStations() |
Returns the list of all stations of this conveyor.
|
ConveyorNode<?> |
getTarget() |
Returns the target node of the conveyor.
|
ConveyorType |
getType() |
Returns the type of this conveyor.
|
double |
getWidth(LengthUnits units) |
Returns the width of this conveyor
|
boolean |
isAccumulating() |
Returns true if the conveyor can accumulate objects, false otherwise.
|
boolean |
isBidirectional() |
Returns the 'bidirectional' property (
true by default). |
boolean |
isChangingDirection() |
Returns true if this conveyor is in the process of changing direction, returns false otherwise
|
boolean |
isDrawStands() |
Returns
true if this conveyor is drawn with stands |
boolean |
isFailed() |
Returns true if the conveyor is currently failed, returns false otherwise.
|
boolean |
isMaximumPriority() |
Returns true if the conveyor has the greatest priority.
|
boolean |
isObstacle() |
Returns true if this conveyor is considered an obstacle by transporters moving in free space mode.
|
boolean |
isReversible() |
Returns the 'reversible' property (
false by default). |
boolean |
isStopped() |
Returns true if the conveyor is currently stopped, false otherwise.
|
java.util.Iterator<MarkupSegment> |
iterator() |
Creates and returns read-only iterator over segments
|
double |
length() |
Returns the length of markup element, used e.g.
|
double |
length(LengthUnits units) |
Returns the length of markup element, used e.g.
|
void |
onDirectionChanged(java.util.List<T> agents) |
|
void |
onFailed() |
|
void |
onLeadingEdgeEnter(T agent) |
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. Callback action. |
void |
onLeadingEdgeExit(T agent) |
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. Callback action. |
void |
onMotionChanged() |
|
void |
onRepaired() |
|
void |
onStarted() |
|
void |
onStopped() |
|
void |
onTrailingEdgeEnter(T agent) |
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. Callback action. |
void |
onTrailingEdgeExit(T agent) |
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. Callback action. |
double |
priority(T agent) |
|
Point |
randomPointInside(java.util.Random rng,
Point out) |
Returns the randomly chosen point inside/along the given space markup element.
|
boolean |
removeAgent(Agent agent) |
Removes the given agent from the conveyor.
|
void |
repair() |
Repairs conveyor, makes it available again.
|
void |
run() |
Launches the conveyor.
|
void |
setAcceleration(double acceleration,
AccelerationUnits units) |
Sets the new acceleration for the conveyor in the specified acceleration units.
|
void |
setBidirectional(boolean bidirectional) |
Sets the 'bidirectional' property (
true by default). |
void |
setCellSize(double size,
LengthUnits units) |
|
void |
setDeceleration(double deceleration,
AccelerationUnits units) |
Sets the new deceleration for the conveyor in the specified acceleration units.
|
void |
setDirection(ConveyorDirection direction) |
Sets the direction of this conveyor.
|
void |
setDrawStands(boolean drawStands) |
Sets to draw stands for conveyor or not
|
void |
setGap(double gapBetweenItems,
LengthUnits units) |
|
void |
setInitialSpeed(double initialSpeed,
SpeedUnits units) |
|
void |
setLineColor(java.awt.Paint lineColor) |
Sets the line color (or
Texture ) of the markup element. |
void |
setLineWidth(double widthInPixels) |
This method is internal and shouldn't be called by user.
it may be removed in future. |
void |
setMaximumPriority(boolean maximumPriority) |
|
void |
setMaxSpeed(double maxSpeed,
SpeedUnits units) |
Sets the new maximum speed of the conveyor in the specified speed units.
|
void |
setObstacle(boolean isObstacle) |
Sets this conveyor as an obstacle for transporters moving in free space mode.
|
void |
setReversible(boolean reversible) |
Sets the 'reversible' property (
true by default). |
void |
setSource(ConveyorNode<?> node) |
Sets source node of this path.
|
void |
setStandsLevel(double standsLevel) |
Set the base Z-level to draw conveyor stands from.
|
void |
setTarget(ConveyorNode<?> node) |
Sets source node of this path.
|
void |
setType(ConveyorType type) |
Sets the type of this conveyor.
|
void |
setWidth(double width,
LengthUnits units) |
Sets the width of this conveyor
|
int |
size() |
Returns the number of agents currently being conveyed.
|
void |
stop() |
Stops the conveyor.
|
java.lang.String |
toString() |
|
void |
updateDynamicProperties() |
Updates dynamic properties of this shape only (without structural contents, if any) in a given context.
Method should be overridden for shapes with dynamic properties. |
void |
validate() |
|
Modifier and Type | Method | Description |
---|
getLevel, getNetwork, setNetwork
error, getDrawMode, getFullName, getOutsideLevelZ, getPresentable, getSpace, initialize, isClickHandled, isPublic, onClick, remove, setDrawMode, setOwner
discardOwner, executeUserAction, findSVGElement, getName, getSVGId, initializeInternal, isVisible, onAggregatorInitialized, onAggregatorVisibilityChanged, removeSVGFromOwner, resetSVGState, setVisible, updateDynamicPropertiesStructural, updateSVGProperties
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
postInitialize
getSpace
Methods inherited from interface com.anylogic.engine.markup.material_handling.IMaterialMarkupLibraryDescriptor
getMarkup, setMarkup
getNetwork, getSpace, randomPointInside, randomPointInside, randomPointInside
getName, getPathEnd
forEach, spliterator
public ConveyorPath()
@Deprecated public ConveyorPath(Agent owner, ShapeDrawMode drawMode, boolean isPublic)
- Parameters:
owner
-drawMode
-isPublic
-
@AnyLogicInternalAPI @Deprecated public ConveyorPath(Agent owner, ShapeDrawMode drawMode, boolean isPublic, boolean isObstacle, double widthInMeters, java.awt.Paint color, boolean drawStands, double standsLevel, com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T> descriptor, MarkupSegment... segments)
@AnyLogicInternalAPI @AnyLogicInternalCodegenAPI public ConveyorPath(Agent owner, ShapeDrawMode drawMode, boolean isPublic, boolean isObstacle, double widthInMeters, java.awt.Paint color, boolean drawStands, double standsLevel, com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T> descriptor, ConveyorNode<?> source, ConveyorNode<?> target, MarkupSegment... segments)
it may be removed/renamed in future. It is public due to technical reasons.
@AnyLogicInternalAPI public com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T> getLibraryDescriptor()
public java.util.List<PositionOnConveyor<T>> getPositionsOnConveyor()
- Returns:
- the list of all PositionOnConveyor elements on this conveyor
public java.util.List<ConveyorStation<T>> getStations()
- Returns:
- the list of all stations of this conveyor.
public java.util.List<ConveyorSpur<T>> getSpurs()
- Returns:
- the list of conveyor spur elements of this conveyor.
@Deprecated public java.util.List<ConveyorSpur<T>> getSplitMerges()
getSpurs()
instead@AnyLogicInternalAPI public NetworkPort createPortInternal(PathEndType endType)
public NetworkPort createPort(PathEndType endType)
- Parameters:
endType
- determines the port's location- Returns:
- new network port
public NetworkPort createPort(PathEndType endType, NetworkPort pairedPort)
- Parameters:
endType
- determines the port's locationpairedPort
- another port to be paired with the new one. May be a port, located on another conveyor or a lift port or a conveyor spur. Should not benull
- Returns:
- new network port
public ConveyorNode<?> getSource()
- Specified by:
getSource
in interfaceIPath<T extends Agent>
- Returns:
- the source node of the conveyor.
public void setSource(ConveyorNode<?> node)
IPath
initialize()
method.- Specified by:
setSource
in interfaceIPath<T extends Agent>
- Parameters:
node
- instance ofcom.anylogic.engine.markup.INode
interface
public ConveyorNode<?> getTarget()
- Specified by:
getTarget
in interfaceIPath<T extends Agent>
- Returns:
- the target node of the conveyor.
public void setTarget(ConveyorNode<?> node)
IPath
initialize()
method.- Specified by:
setTarget
in interfaceIPath<T extends Agent>
- Parameters:
node
- instance ofcom.anylogic.engine.markup.INode
interface
public ConveyorNode<?> getOtherNode(ConveyorNode<?> n)
- Specified by:
getOtherNode
in interfaceIPath<T extends Agent>
- Parameters:
n
- the node (one of the path endings)- Returns:
- the second (other) node of the conveyor.
public void setDrawStands(boolean drawStands)
- Parameters:
drawStands
-true
to draw stands- See Also:
setStandsLevel(double)
public boolean isDrawStands()
true
if this conveyor is drawn with stands- See Also:
getStandsLevel()
public void setStandsLevel(double standsLevel)
- Parameters:
standsLevel
- the base level.
public double getStandsLevel()
- See Also:
isDrawStands()
public boolean isReversible()
false
by default).- Specified by:
isReversible
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
- Returns:
true
for conveyors which allow movements in both directions,false
for conveyors which allow movements from source to target only
public void setReversible(boolean reversible)
true
by default).- Specified by:
setReversible
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
- Parameters:
reversible
-true
for conveyors which allow movements in both directions,false
for conveyors which allow movements from source to target only- See Also:
isReversible()
@AnyLogicInternalAPI public boolean isBidirectional()
IPath
true
by default).- Specified by:
isBidirectional
in interfaceIPath<T extends Agent>
- Returns:
true
for paths which allow movements in both directions,false
for paths which allow movements from source to target only
@AnyLogicInternalAPI public void setBidirectional(boolean bidirectional)
IPath
true
by default).- Specified by:
setBidirectional
in interfaceIPath<T extends Agent>
- Parameters:
bidirectional
-true
for paths which allow movements in both directions,false
for paths which allow movements from source to target only- See Also:
IPath.isBidirectional()
public ConveyorDirection getDirection()
Valid values are:
- CONVEYOR_FORWARD
- CONVEYOR_BACKWARD
- Specified by:
getDirection
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
- Returns:
- the direction of this conveyor
public void setDirection(ConveyorDirection direction)
Valid values are:
- CONVEYOR_FORWARD
- CONVEYOR_BACKWARD
- Specified by:
setDirection
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
- Parameters:
type
- the direction
public void changeDirection()
public boolean isChangingDirection()
- Specified by:
isChangingDirection
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
- Returns:
- true if this conveyor is in the process of changing direction, returns false otherwise
public void onDirectionChanged(java.util.List<T> agents)
- Specified by:
onDirectionChanged
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
public java.awt.Color getLineColor()
IPath
null
if markup element has no line color or
has textured line (in this case IPath.getLineTexture()
should be used instead)- Specified by:
getLineColor
in interfaceIPath<T extends Agent>
- Returns:
- the line color of the markup element
public Texture getLineTexture()
IPath
- Specified by:
getLineTexture
in interfaceIPath<T extends Agent>
- Returns:
- the line texture of the markup element
public void setLineColor(java.awt.Paint lineColor)
IPath
Texture
) of the markup element.- Specified by:
setLineColor
in interfaceIPath<T extends Agent>
- Parameters:
lineColor
- the new line color, null = do not draw the markup element line
public double getWidth(LengthUnits units)
- Parameters:
units
- length units- Returns:
- the width of this conveyor
public void setWidth(double width, LengthUnits units)
- Parameters:
width
- widthunits
- length units
@AnyLogicInternalAPI public double getLineWidth()
it may be removed in future.
- Specified by:
getLineWidth
in interfaceIPath<T extends Agent>
- Returns:
- the line width of the markup element
@AnyLogicInternalAPI public void setLineWidth(double widthInPixels)
it may be removed in future.
- Specified by:
setLineWidth
in interfaceIPath<T extends Agent>
- Parameters:
widthInPixels
- the new line width of the markup element
public void addSegment(MarkupSegment segment)
- Parameters:
segment
- the segment, should be initialized if was created using no-argument constructor
public int getSegmentCount()
IPath
- Specified by:
getSegmentCount
in interfaceIPath<T extends Agent>
- Returns:
- the number of segments
public MarkupSegment getSegment(int index)
IPath
- Specified by:
getSegment
in interfaceIPath<T extends Agent>
- Parameters:
index
- the segment index, [0 ..IPath.getSegmentCount()
- 1]- Returns:
- the segment
public java.util.Iterator<MarkupSegment> iterator()
- Specified by:
iterator
in interfaceIPath<T extends Agent>
- Specified by:
iterator
in interfacejava.lang.Iterable<T extends Agent>
public double length()
AnimationMovingLocationProvider
- Specified by:
length
in interfaceAnimationMovingLocationProvider
- Returns:
- the length of markup element
public double length(LengthUnits units)
AnimationMovingLocationProvider
- Specified by:
length
in interfaceAnimationMovingLocationProvider
- Returns:
- the length of markup element
public Point getStartPoint()
IPath
- Specified by:
getStartPoint
in interfaceIPath<T extends Agent>
- Returns:
- the Point object with coordinates of the first point
public Point getStartPoint(Point out)
IPath
- Specified by:
getStartPoint
in interfaceIPath<T extends Agent>
- Parameters:
out
- output object to write to, may benull
- Returns:
- the Point object with coordinates of the first point
public Point getEndPoint()
IPath
- Specified by:
getEndPoint
in interfaceIPath<T extends Agent>
- Returns:
- the Point object with coordinates of the last point
public Point getEndPoint(Point out)
IPath
- Specified by:
getEndPoint
in interfaceIPath<T extends Agent>
- Parameters:
out
- output object to write to, may benull
- Returns:
- the Point object with coordinates of the last point
public Position getStartPosition()
- Returns:
- the Position object with coordinates of the first position
public Position getStartPosition(Position out)
IPath
- Specified by:
getStartPosition
in interfaceIPath<T extends Agent>
- Parameters:
out
- output object to write to, may benull
- Returns:
- the Position object with coordinates of the first position
public Position getEndPosition()
- Returns:
- the Position object with coordinates of the last position
public Position getEndPosition(Position out)
IPath
- Specified by:
getEndPosition
in interfaceIPath<T extends Agent>
- Parameters:
out
- output object to write to, may benull
- Returns:
- the Position object with coordinates of the last position
public boolean contains(double px, double py)
MarkupShape
- Specified by:
contains
in interfaceINetworkMarkupElement
- 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
public boolean containsSq(double px, double py, double squareDistance)
public double getNearestPoint(Point givenPoint, Point out)
INetworkMarkupElement
output
object) the point in this space markup element
nearest to the given point. Returns the square of distance to the point.- Specified by:
getNearestPoint
in interfaceINetworkMarkupElement
- Parameters:
givenPoint
- given pointout
- the output point to write result to.- Returns:
- the square of distance to the nearest point
public Point randomPointInside(java.util.Random rng, Point out)
INetworkMarkupElement
- Specified by:
randomPointInside
in interfaceINetworkMarkupElement
- Parameters:
rng
- the random number generator.out
- output object to write to, may benull
- Returns:
- the randomly chosen point
public Position getPosition(double value, double maxValue, Position out)
AnimationMovingLocationProvider
value
,
assuming that 0
is start and maxValue
is end- Specified by:
getPosition
in interfaceAnimationMovingLocationProvider
- Returns:
- position by offset
public Position getPosition(int index, int totalNumber, Position out)
AnimationStaticLocationProvider
In case of any wrong argument returns zero-index position (position for index=0 with totalNumber=1).
- Specified by:
getPosition
in interfaceAnimationStaticLocationProvider
- Parameters:
index
- the index of some item positions, should be not negative and less thantotalNumber
totalNumber
- the total number of item positions, should be positiveout
- output object to write to, may benull
- Returns:
- the Position object with coordinates of the requested item position
public Position getPositionAtOffset(double offset, Position out)
IPath
offset
distance calculated from start point.- Specified by:
getPositionAtOffset
in interfaceIPath<T extends Agent>
- Parameters:
offset
- offset, non-negative value, should be less or equal to the full length.out
- output object to write to, may benull
- Returns:
- the Position object with coordinates of the point with the given offset and orientation along markup element line at this point
public Position getPositionAtOffset(double offset, LengthUnits units, Position out)
IPath
offset
distance calculated from start point.- Specified by:
getPositionAtOffset
in interfaceIPath<T extends Agent>
- Parameters:
offset
- offset, non-negative value, should be less or equal to the full length.units
- the length unitsout
- output object to write to, may benull
- Returns:
- the Position object with coordinates of the point with the given offset and orientation along markup element line at this point
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
public ConveyorType getType()
Valid values are:
- CONVEYOR_TYPE_ROLLER
- CONVEYOR_TYPE_BELT
- CONVEYOR_TYPE_CELL
- Specified by:
getType
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
- Returns:
- the type of this conveyor
public void setType(ConveyorType type)
Valid values are:
- CONVEYOR_TYPE_ROLLER
- CONVEYOR_TYPE_BELT
- CONVEYOR_TYPE_CELL
- Specified by:
setType
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
- Parameters:
type
- the type
public boolean isAccumulating()
- Returns:
- true if the conveyor can accumulate objects, false otherwise.
public boolean isStopped()
- Specified by:
isStopped
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
- Returns:
- true if the conveyor is currently stopped, false otherwise.
public void stop()
- Specified by:
stop
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
public void run()
- Specified by:
run
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
public double getMaxSpeed(SpeedUnits units)
- Specified by:
getMaxSpeed
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
- Parameters:
units
- - one of the speed unit constants- Returns:
- the maximum speed of the conveyor
public void setMaxSpeed(double maxSpeed, SpeedUnits units)
- Specified by:
setMaxSpeed
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
- Parameters:
speed
- - a new maximum speed valueunits
- - a constant defining the speed units
public double getInitialSpeed(SpeedUnits units)
- Specified by:
getInitialSpeed
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
- Parameters:
units
- - a constant defining the speed units- Returns:
- the initial speed of the conveyor
public void setInitialSpeed(double initialSpeed, SpeedUnits units)
- Specified by:
setInitialSpeed
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
public double getCurrentSpeed(SpeedUnits units)
- Specified by:
getCurrentSpeed
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
- Parameters:
units
- - a constant defining the speed units- Returns:
- the current speed of the conveyor
public double getCurrentAcceleration(AccelerationUnits units)
- Specified by:
getCurrentAcceleration
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
public double getAcceleration(AccelerationUnits units)
- Specified by:
getAcceleration
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
- Parameters:
units
- - one of the acceleration unit constants.- Returns:
- the acceleration of the conveyor
public void setAcceleration(double acceleration, AccelerationUnits units)
- Specified by:
setAcceleration
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
- Parameters:
acceleration
- - the new acceleration value.units
- - one of the acceleration unit constants.
public double getDeceleration(AccelerationUnits units)
- Specified by:
getDeceleration
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
- Parameters:
units
- - one of the acceleration unit constants.- Returns:
- the deceleration of the conveyor
public double getCellSize(LengthUnits units)
- Specified by:
getCellSize
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
public void setCellSize(double size, LengthUnits units)
- Specified by:
setCellSize
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
public void setDeceleration(double deceleration, AccelerationUnits units)
- Specified by:
setDeceleration
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
- Parameters:
deceleration
- - the new deceleration value.units
- - one of the acceleration unit constants.
public double getGap(LengthUnits units)
- Specified by:
getGap
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
- Parameters:
units
- - one of the length unit constants.- Returns:
- the minimum required gap between material items of this conveyor
public void setGap(double gapBetweenItems, LengthUnits units)
- Specified by:
setGap
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
public int size()
- Specified by:
size
in interfacecom.anylogic.engine.markup.material_handling.IMaterialAreaLocation<T extends Agent>
- Returns:
- the number of agents currently being conveyed.
public T getAgent(int index)
- Specified by:
getAgent
in interfacecom.anylogic.engine.markup.material_handling.IMaterialAreaLocation<T extends Agent>
- Returns:
- the agent at a given position
public java.util.List<T> getAgents()
- Specified by:
getAgents
in interfacecom.anylogic.engine.markup.material_handling.IMaterialAreaLocation<T extends Agent>
- Returns:
- the list of agents (material items) that are currently conveyed
public T getAgent(double offset, LengthUnits units)
- Specified by:
getAgent
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
public java.util.List<T> getAgents(double offset, double length, LengthUnits units)
- Specified by:
getAgents
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
public boolean removeAgent(Agent agent)
- Specified by:
removeAgent
in interfacecom.anylogic.engine.markup.material_handling.IMaterialAreaLocation<T extends Agent>
- Returns:
- If the agent is not on the conveyor, returns false, otherwise returns true.
public boolean contains(Agent agent)
- Specified by:
contains
in interfacecom.anylogic.engine.markup.material_handling.IMaterialPointLocation<T extends Agent>
public void onLeadingEdgeEnter(T agent)
com.anylogic.engine.markup.material_handling.IMaterialPointLocation
it may be removed/renamed in future. It is public due to technical reasons.
Callback action.
- Specified by:
onLeadingEdgeEnter
in interfacecom.anylogic.engine.markup.material_handling.IMaterialPointLocation<T extends Agent>
- Parameters:
agent
- the agent.
public void onTrailingEdgeEnter(T agent)
com.anylogic.engine.markup.material_handling.IMaterialAreaLocation
it may be removed/renamed in future. It is public due to technical reasons.
Callback action.
- Specified by:
onTrailingEdgeEnter
in interfacecom.anylogic.engine.markup.material_handling.IMaterialAreaLocation<T extends Agent>
- Parameters:
agent
- the agent.
public void onLeadingEdgeExit(T agent)
com.anylogic.engine.markup.material_handling.IMaterialAreaLocation
it may be removed/renamed in future. It is public due to technical reasons.
Callback action.
- Specified by:
onLeadingEdgeExit
in interfacecom.anylogic.engine.markup.material_handling.IMaterialAreaLocation<T extends Agent>
- Parameters:
agent
- the agent.
public void onTrailingEdgeExit(T agent)
com.anylogic.engine.markup.material_handling.IMaterialPointLocation
it may be removed/renamed in future. It is public due to technical reasons.
Callback action.
- Specified by:
onTrailingEdgeExit
in interfacecom.anylogic.engine.markup.material_handling.IMaterialPointLocation<T extends Agent>
- Parameters:
agent
- the agent.
public void onStarted()
- Specified by:
onStarted
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
public void onStopped()
- Specified by:
onStopped
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
public boolean isFailed()
- Specified by:
isFailed
in interfacecom.anylogic.engine.markup.material_handling.IMaterialFallible
- Returns:
- true if the conveyor is currently failed, returns false otherwise.
public void fail()
- Specified by:
fail
in interfacecom.anylogic.engine.markup.material_handling.IMaterialFallible
public void repair()
- Specified by:
repair
in interfacecom.anylogic.engine.markup.material_handling.IMaterialFallible
public void onFailed()
- Specified by:
onFailed
in interfacecom.anylogic.engine.markup.material_handling.IMaterialFallible
public void onRepaired()
- Specified by:
onRepaired
in interfacecom.anylogic.engine.markup.material_handling.IMaterialFallible
@AnyLogicInternalAPI public void onMotionChanged()
public boolean isMaximumPriority()
- Specified by:
isMaximumPriority
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
- Returns:
- Returns true if the conveyor has the greatest priority.
public void setMaximumPriority(boolean maximumPriority)
- Specified by:
setMaximumPriority
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
public double priority(T agent)
- Specified by:
priority
in interfacecom.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
@AnyLogicInternalAPI public BoundingRectangle getBoundingRectangle()
@AnyLogicInternalCodegenAPI public void updateDynamicProperties()
AbstractMarkup
Method should be overridden for shapes with dynamic properties. Note that you should call super.updateDynamicProperties() at the end of overridden method
- Overrides:
updateDynamicProperties
in classAbstractMarkup
public boolean isObstacle()
- Returns:
- a flag that tells whether this conveyor is an obstacle or not
public void setObstacle(boolean isObstacle)
- Parameters:
isObstacle
- if true, the conveyor is set as an obstacle. Otherwise, not.
@AnyLogicInternalAPI public void validate()
@AnyLogicInternalAPI public default NetworkPort createPort(IPath<?> path, PathEndType endType)
@AnyLogicInternalAPI public default NetworkPort createPort(IPath<?> path, PathEndType endType, NetworkPort pairedPort)
-
How can we improve this article?
-