AnyLogic AnyLogic
Expand
Font size
All Implemented Interfaces:
AggregatableAnimationElement, HasLevel, IMarkupLibraryDescriptor, INetworkMarkupElement, com.anylogic.engine.markup.material_handling.IMaterialMarkupLibraryDescriptor, com.anylogic.engine.markup.material_handling.IMaterialPointLocation<T>, com.anylogic.engine.markup.material_handling.IPositionOnConveyorDescriptor<T>, SVGElement, java.io.Serializable

public class PositionOnConveyor<T extends Agent>
extends ConveyorPathPart<T>
implements com.anylogic.engine.markup.material_handling.IPositionOnConveyorDescriptor<T>
Position on conveyor is the graphical element that is used to define the exact position on the conveyor.

It can be used to:

  • Define the location where new material items will be placed on the conveyor (by the Convey and ConveyorEnter blocks). Note that both blocks place the leading edge of the added material item at the Position on conveyor location.
  • Set the destination point for the material items being transported by conveyor(s) (in the Convey block).
  • Simulate photo-eyes, scanners and other devices that perform some instant actions with the conveyed material items. To model the operation, use the callbacks actions in the element's Actions properties section. If the operation requires some time, use station instead.
  • Model different types of stops and escapement devices (e.g. blade stop, claw stop, pneumatic escapements). You can simulate the conveyor blocking and unblocking operations by calling the element's block() and unblock() functions.
See Also:
Serialized Form

Constructor Summary

Constructors 
PositionOnConveyor​(ConveyorPath<? extends T> conveyor)  
PositionOnConveyor​(ConveyorPath<? extends T> conveyor, double offset)
Constructor
PositionOnConveyor​(ConveyorPath<? extends T> conveyor, ShapeDrawMode drawMode, boolean isPublic, double offset, com.anylogic.engine.markup.material_handling.IPositionOnConveyorDescriptor<T> descriptor)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
Constructor Description

Method Summary

All Methods Instance Methods Concrete Methods 
void block()
Blocks the conveyor movement.
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. in the same system with the coordinates of this shape, x and y)
boolean contains​(Agent agent)
Returns true if the given agent (material item) is currenty located at the position on conveyor, returns false otherwise.
T getAgent()
Returns the agent (material item) that is currenty located at the position on conveyor, returns null if none.
com.anylogic.engine.markup.material_handling.IPositionOnConveyorDescriptor<T> getLibraryDescriptor()  
double getNearestPoint​(Point givenPoint, Point out)
Calculates (using the output object) the point in this space markup element nearest to the given point.
boolean isBlocked()
Returns true if this Position on conveyor element is currently set to block the conveyor movement., returns false otherwise.
void onCellEnter()
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 onCellExit()
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 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 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.
Point randomPointInside​(java.util.Random rng, Point out)
Returns the randomly chosen point inside/along the given space markup element.
T removeAgent()
Removes the agent from the conveyor.
void unblock()
Unblocks the conveyor movement.
Modifier and Type Method Description

Methods inherited from class com.anylogic.engine.markup.ConveyorPathPart

getConveyor, getOffset, getOffset, setConveyor, setOffset, setOffset

Methods inherited from class com.anylogic.engine.markup.ConveyorMarkupElement

getLevel, getNetwork, setNetwork

Methods inherited from class com.anylogic.engine.markup.MarkupShape

error, getDrawMode, getFullName, getOutsideLevelZ, getPresentable, getSpace, initialize, isClickHandled, isPublic, onClick, remove, setDrawMode, setOwner

Methods inherited from class com.anylogic.engine.markup.AbstractMarkup

discardOwner, executeUserAction, findSVGElement, getName, getSVGId, initializeInternal, isVisible, onAggregatorInitialized, onAggregatorVisibilityChanged, removeSVGFromOwner, resetSVGState, setVisible, updateDynamicProperties, updateDynamicPropertiesStructural, updateSVGProperties

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Methods inherited from interface com.anylogic.engine.markup.AggregatableAnimationElement

postInitialize

Methods inherited from interface com.anylogic.engine.markup.material_handling.IMaterialMarkupLibraryDescriptor

getMarkup, setMarkup

Methods inherited from interface com.anylogic.engine.markup.INetworkMarkupElement

getSpace, randomPointInside, randomPointInside, randomPointInside

Constructor Detail

PositionOnConveyor

public PositionOnConveyor​(ConveyorPath<? extends T> conveyor)

PositionOnConveyor

public PositionOnConveyor​(ConveyorPath<? extends T> conveyor,
                          double offset)
Constructor
Parameters:
conveyor - the conveyor
offset - offset measured from the beginning of conveyor to this conveyor part, in pixels.

PositionOnConveyor

@AnyLogicInternalAPI
@Deprecated
public PositionOnConveyor​(ConveyorPath<? extends T> conveyor,
                          ShapeDrawMode drawMode,
                          boolean isPublic,
                          double offset,
                          com.anylogic.engine.markup.material_handling.IPositionOnConveyorDescriptor<T> descriptor)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
Parameters:
conveyor -
drawMode -
isPublic -
offset -
descriptor -

Method Detail

getLibraryDescriptor

@AnyLogicInternalAPI
public com.anylogic.engine.markup.material_handling.IPositionOnConveyorDescriptor<T> getLibraryDescriptor()

getNearestPoint

public double getNearestPoint​(Point givenPoint,
                              Point out)
Description copied from interface: INetworkMarkupElement
Calculates (using the 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 interface INetworkMarkupElement
Parameters:
givenPoint - given point
out - the output point to write result to.
Returns:
the square of distance to the nearest point

randomPointInside

public Point randomPointInside​(java.util.Random rng,
                               Point out)
Description copied from interface: INetworkMarkupElement
Returns the randomly chosen point inside/along the given space markup element. This method utilises the given Random Number Generator.
Specified by:
randomPointInside in interface INetworkMarkupElement
Parameters:
rng - the random number generator.
out - output object to write to, may be null
Returns:
the randomly chosen point

contains

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 interface INetworkMarkupElement
Specified by:
contains in class MarkupShape
Parameters:
px - the x coordinate relative to this shape's container
py - the y coordinate relative to this shape's container
Returns:
true if the shape contains the point with the given coordinates

isBlocked

public boolean isBlocked()
Returns true if this Position on conveyor element is currently set to block the conveyor movement., returns false otherwise.
Specified by:
isBlocked in interface com.anylogic.engine.markup.material_handling.IPositionOnConveyorDescriptor<T extends Agent>
Returns:
true if this Position on conveyor element is currently set to block the conveyor movement., returns false otherwise.

block

public void block()
Blocks the conveyor movement. If some material item is currenty passing this Position on conveyor element, the conveyor will be blocked when this item will completely pass through the element.
Specified by:
block in interface com.anylogic.engine.markup.material_handling.IPositionOnConveyorDescriptor<T extends Agent>

unblock

public void unblock()
Unblocks the conveyor movement.
Specified by:
unblock in interface com.anylogic.engine.markup.material_handling.IPositionOnConveyorDescriptor<T extends Agent>

getAgent

public T getAgent()
Returns the agent (material item) that is currenty located at the position on conveyor, returns null if none.
Specified by:
getAgent in interface com.anylogic.engine.markup.material_handling.IPositionOnConveyorDescriptor<T extends Agent>
Returns:
the agent (material item) that is currenty located at the position on conveyor, returns null if none.

contains

public boolean contains​(Agent agent)
Returns true if the given agent (material item) is currenty located at the position on conveyor, returns false otherwise.
Specified by:
contains in interface com.anylogic.engine.markup.material_handling.IMaterialPointLocation<T extends Agent>
Parameters:
agent - - the agent (material item) to be checked for being at the Position on conveyor location.
Returns:
true if the given agent (material item) is currenty located at the position on conveyor, returns false otherwise.

removeAgent

public T removeAgent()
Removes the agent from the conveyor. The agent will be removed only if it is currently located at the Position on conveyor location (the item's leading edge has reached/passed by the position and the trailing edge has not reached the position yet).
Specified by:
removeAgent in interface com.anylogic.engine.markup.material_handling.IPositionOnConveyorDescriptor<T extends Agent>
Returns:
If the agent was removed successfully, returns agent, otherwise returns null.

onLeadingEdgeEnter

public void onLeadingEdgeEnter​(T agent)
Description copied from interface: com.anylogic.engine.markup.material_handling.IMaterialPointLocation
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.
Specified by:
onLeadingEdgeEnter in interface com.anylogic.engine.markup.material_handling.IMaterialPointLocation<T extends Agent>
Parameters:
agent - the agent.

onTrailingEdgeExit

public void onTrailingEdgeExit​(T agent)
Description copied from interface: com.anylogic.engine.markup.material_handling.IMaterialPointLocation
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.
Specified by:
onTrailingEdgeExit in interface com.anylogic.engine.markup.material_handling.IMaterialPointLocation<T extends Agent>
Parameters:
agent - the agent.

onCellEnter

@AnyLogicInternalCodegenAPI
public void onCellEnter()
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.
Specified by:
onCellEnter in interface com.anylogic.engine.markup.material_handling.IPositionOnConveyorDescriptor<T extends Agent>

onCellExit

@AnyLogicInternalCodegenAPI
public void onCellExit()
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.
Specified by:
onCellExit in interface com.anylogic.engine.markup.material_handling.IPositionOnConveyorDescriptor<T extends Agent>
How can we improve this article?