com.xj.anylogic.engine
Class AgentContinuous3D
java.lang.Object
com.xj.anylogic.engine.Presentable
com.xj.anylogic.engine.Utilities
com.xj.anylogic.engine.ActiveObject
com.xj.anylogic.engine.Agent
com.xj.anylogic.engine.AgentContinuous
com.xj.anylogic.engine.AgentContinuous3D
- All Implemented Interfaces:
- com.xj.anylogic.engine.internal.Child, java.io.Serializable
public class AgentContinuous3D
- extends AgentContinuous
A subclass of ActiveObject designed to support agent based modeling in
continuous 3D space, in particular:
- time (continuous or discrete)
- 3D continuous space
- connections between agents, networks (e.g. social) and their visualization
- communication - message passing and broadcasting
A user-defined agent class should be a subclass of this class
in order to use those features.
If your model is agent based, but none of the above features are required,
it is recommended to use regular ActiveObject as a base class for your agents,
and not this class: Agent classes require 36+ bytes more memory than ActiveObject.
- Author:
- XJ Technologies Company Ltd. www.anylogic.com
- See Also:
- Serialized Form
| Fields inherited from class com.xj.anylogic.engine.Agent |
ALL, ALL_CONNECTED, ALL_NEIGHBORS, EAST, NORTH, NORTHEAST, NORTHWEST, RANDOM, RANDOM_CONNECTED, RANDOM_NEIGHBOR, SOUTH, SOUTHEAST, SOUTHWEST, WEST |
| Fields inherited from class com.xj.anylogic.engine.ActiveObject |
DRAW_PARAMETER_DYNAMIC, DRAW_SD_ARRAY, DRAW_SD_CONSTANT, DRAW_SD_EXTERNAL, DRAW_SD_LINK_DELAY, DRAW_SD_LINK_INITIAL, DRAW_SD_NEGATIVE, DRAW_SD_NO_SOURCE, DRAW_SD_NO_TARGET, DRAW_SD_PUBLIC_ONLY, DRAW_SD_SHADOW, DRAW_SD_ZERO, EVENT_TIMEOUT_MODE_CYCLIC, EVENT_TIMEOUT_MODE_ONCE, EVENT_TIMEOUT_MODE_USER |
| Fields inherited from class com.xj.anylogic.engine.Utilities |
AM, APRIL, AUGUST, DAY, DECEMBER, FEBRUARY, FRIDAY, HOUR, infinity, JANUARY, JULY, JUNE, MARCH, MAY, MILLISECOND, MINUTE, MONDAY, MONTH, NOVEMBER, OCTOBER, PM, SATURDAY, SECOND, SEPTEMBER, SUNDAY, THURSDAY, TIME_UNIT_DAY, TIME_UNIT_HOUR, TIME_UNIT_MILLISECOND, TIME_UNIT_MINUTE, TIME_UNIT_SECOND, TIME_UNIT_WEEK, TUESDAY, UNDECIMBER, WEDNESDAY, WEEK, YEAR |
| Fields inherited from class com.xj.anylogic.engine.Presentable |
ALIGNMENT_CENTER, ALIGNMENT_LEFT, ALIGNMENT_RIGHT, CAD_ANTIALIASING, CAD_INVERTED, LINE_STYLE_DASHED, LINE_STYLE_DOTTED, LINE_STYLE_SOLID, NAVIGATION_FULL, NAVIGATION_LIMITED_TO_Z_ABOVE_ZERO, NAVIGATION_NONE, NAVIGATION_ROTATION_ONLY, SHAPE_ARC, SHAPE_BUTTON, SHAPE_CAD, SHAPE_CHART_BAR, SHAPE_CHART_HISTOGRAM, SHAPE_CHART_HISTOGRAM2D, SHAPE_CHART_PIE, SHAPE_CHART_PLOT, SHAPE_CHART_STACK, SHAPE_CHART_TIME_COLOR, SHAPE_CHART_TIME_PLOT, SHAPE_CHART_TIME_STACK, SHAPE_CHECKBOX, SHAPE_COMBOBOX, SHAPE_CURVE, SHAPE_EMBEDDED_OBJECT, SHAPE_FILECHOOSER, SHAPE_GROUP, SHAPE_IMAGE, SHAPE_LINE, SHAPE_LISTBOX, SHAPE_OVAL, SHAPE_PIXEL, SHAPE_POLYLINE, SHAPE_PROGRESSBAR, SHAPE_RADIOBUTTONS, SHAPE_RECTANGLE, SHAPE_ROUNDED_RECTANGLE, SHAPE_SLIDER, SHAPE_TEXT, SHAPE_TEXTFIELD |
|
Method Summary |
void |
connectTo(AgentContinuous3D a)
Creates a bi-directional connection between this agent and a given
other agent. |
void |
deliver(java.lang.Object msg,
AgentContinuous3D dest)
Delivers a message to a given agent immediately during this method call. |
double |
distanceTo(Agent other)
Calculates the distance from this agent to another one in continuous 3D space. |
double |
distanceTo(double x,
double y)
Deprecated. this method is public only for easy translation of 2D models to 3D
and may be removed in future releases. Please use distanceTo(double, double, double)
method instead |
double |
distanceTo(double x,
double y,
double z)
Calculates the distance from this agent to a given point in continuous 3D space. |
AgentContinuous3D |
getConnectedAgent(int index)
Returns the connected agent with a given index. |
java.util.LinkedList<AgentContinuous3D> |
getConnections()
Returns a collection of agents connected to this agent (bi-directionally),
or null if there have not been any connections yet. |
EnvironmentContinuous3D |
getEnvironment()
Returns the environment where this agent belongs to. |
double |
getRotation()
Returns the current horizontal rotation angle (in radians) of the agent in
continuous 3D space or GIS space. |
double |
getTargetX()
Returns the x of the target location if moving, otherwise current x in
continuous 2D space or GIS space. |
double |
getTargetY()
Returns the y of the target location if moving, otherwise current y in
continuous 2D space or GIS space. |
double |
getTargetZ()
Returns the z of the target location if moving, otherwise current z in
continuous 3D space. |
double |
getVerticalRotation()
Returns the current vertical rotation angle of the agent in
continuous 3D space. |
double |
getZ()
Returns the current (up-to-date) z coordinate of the agent in continuous space. |
void |
jumpTo(double x,
double y)
Deprecated. this method is public only for easy translation of 2D models to 3D
and may be removed in future releases. Please use jumpTo(double, double, double)
method instead |
void |
jumpTo(double x,
double y,
double z)
Instantly moves the agent to a given location. |
void |
moveTo(double x,
double y)
Deprecated. this method is public only for easy translation of 2D models to 3D
and may be removed in future releases. Please use moveTo(double, double, double)
method instead |
void |
moveTo(double x,
double y,
double z)
Starts movement in the direction of the given target location in continuous 3D. |
void |
moveTo(double x,
double y,
double z,
Path3D path)
Starts movement in the direction of the given target location in
continuous 3D space along a given path. |
void |
moveTo(double x,
double y,
Path2D path)
Deprecated. this method is public only for easy translation of 2D models to 3D
and may be removed in future releases. Please use moveTo(double, double, double, Path3D)
method instead |
void |
moveToNearestAgent(java.lang.Iterable<? extends AgentContinuous> agents)
Starts movement to the nearest agent from the given collection. |
void |
onReceive(java.lang.Object msg,
AgentContinuous3D sender)
A callback that is called when the agent receives a message
from another agent. |
void |
send(java.lang.Object msg,
AgentContinuous3D dest)
Sends a message to a given agent. |
void |
setRotation(double rotation)
Sets the horizontal rotation (angle in radians) of the agent animation in continuous 3D
space. |
void |
setRotation(double rotation,
boolean freezeRotation)
Sets the horizontal rotation (angle in radians) of the agent animation in continuous 3D
space. |
void |
setRotation(double rotation,
double verticalRotation)
Sets the rotations (angles in radians) of the agent animation in continuous 3D
space. |
void |
setRotation(double rotation,
double verticalRotation,
boolean freezeRotation)
Sets the rotations (angles in radians) of the agent animation in continuous 3D
space. |
void |
setXY(double x,
double y)
Deprecated. this method is public only for easy translation of 2D models to 3D
and may be removed in future releases. Please use setXYZ(double, double, double)
method instead |
void |
setXYZ(double x,
double y,
double z)
Sets the coordinates of the agent location in continuous 3D space. |
void |
stop()
Stops movement in continuous 3D, if any. |
| Methods inherited from class com.xj.anylogic.engine.AgentContinuous |
getNearestAgent, getShapeRotation, getVelocity, getX, getY, isMoving, isRotationFrozen, onArrival, onDestroy, setVelocity, timeToArrival |
| Methods inherited from class com.xj.anylogic.engine.Agent |
agentInfo, deliver, disconnectFrom, disconnectFromAll, getConnectionsNumber, getShapeX, getShapeY, isConnectedTo, onBeforeStep, onStep, receive, restoreConnections_xjal, send, setEnvironment |
| Methods inherited from class com.xj.anylogic.engine.ActiveObject |
assignInitialConditions_xjal, create, drawActionChart, drawActionChartLink, drawAuxiliaryVariable, drawAuxiliaryVariable, drawBranchExit, drawBranchState, drawBreakBlock, drawCausalLoop, drawCodeBlock, drawConnector, drawDecisionBlock, drawDynamicEvent, drawEmbeddedObjectModel, drawEmbeddedObjectModel, drawEmbeddedObjectModelDefault, drawEmbeddedObjectModelDefault, drawEnvironment, drawEvent, drawFinalState, drawFlow, drawFlow, drawFlowStockDependencyLine, drawHistoryState, drawInitialStatePointer, drawLink, drawLink, drawLocalVariable, drawLoopArea, drawLoopBlock, drawParameter, drawParameter, drawPlainDependencyArc, drawPlainDependencyLine, drawPort, drawReturnBlock, drawSchedule, drawState, drawStatechartEntryPoint, drawStock, drawStock, drawTransition, enterState, error, evaluateRateOf, evaluateRateOf, evaluateTimeoutOf, evaluateTimeoutOf, executeActionOf, executeActionOf, executeActionOf, executeActionOf, executeActionOf, executeActionOf, executeActionOf, executeActionOf, executeActionOf, executeOnReceiveActionOf, executeOnSendActionOf, exitInnerStates, exitState, finishSimulation, formulasExecute_xjal, getCameras3D, getContainerStateOf, getDynamicEvents, getEmbeddedObjects, getEngine, getFirstOccurrenceTime, getFullName, getIndex, getIntegrationManager_xjal, getModeOf, getName, getNameOf, getNameOf, getNameOf, getNameOf, getNameOf, getNameOf, getNameOf, getNameOf, getNameOf, getNameOf, getNameOf, getNameOfState, getOwner, getOwnerShape, getPresentation, getReplicatedCollection, getReplicatedList, getScalarPhaseVector_xjal, getScalarPhaseVectorForInitialConditions_xjal, getScalarRightPart_xjal, getScalarRightPartForInitialConditions_xjal, getStatechartOf, getStatechartOf, getStatechartOf, getStatechartOf, isReplicated, nothingChanged, onChange, onCreate, onStartup, pauseSimulation, putScalarPhaseVector_xjal, putScalarPhaseVectorForInitialConditions_xjal, restoreOwner, runSimulation, setDestroyed, setEngine, setOwnerShape_xjal, setParametersToDefaultValues, setupPlainDependencyArc, start, stateContainsState, stopSimulation, testConditionOf, testConditionOf, testGuardOf, testGuardOf, testGuardOf, testGuardOf, testMessageOf, toString |
| Methods inherited from class com.xj.anylogic.engine.Utilities |
bernoulli, bernoulli, beta, beta, beta, beta, beta, binomial, binomial, binomial, binomial, binomial, briefInfoOn, cauchy, cauchy, cauchy, chi2, chi2, chi2, copyToClipboard, createURL_xjal, date, dateToTime, day, difference, difference, differenceInDateUnits, differenceInDateUnits, dropTime, erlang, erlang, erlang, error, exponential, exponential, exponential, exponential, exponential, exponential, format, format, format, format, format, format, formatDayOfWeek, formatGeoHeading, formatLatitude, formatLongitude, formatMonth, formatTimeInterval, gamma_frac, gamma, gamma, gamma, gamma, gamma, gammaLog, geometric, geometric, getAmPm, getAmPm, getDayOfMonth, getDayOfMonth, getDayOfWeek, getDayOfWeek, getDayOfYear, getDefaultRandomGenerator, getDistance, getDistance, getDistanceFromPointToLine, getDistanceFromPointToLineSq, getDistanceFromPointToSegment, getDistanceFromPointToSegmentSq, getDistanceSq, getDistanceSq, getHour, getHour, getHourOfDay, getHourOfDay, getLength, getLength, getMillisecond, getMillisecond, getMinute, getMinute, getMonth, getMonth, getRandom, getRandom, getSecond, getSecond, getTime, getYear, getYear, gumbel1, gumbel1, gumbel2, gumbel2, hour, hypergeometric, hypergeometric, inspectOf, isLineIntersectingLine, isLineIntersectingRectangle, isPointInsideRectangle, isPointOnTheSameLine, laplace, laplace, limit, limitMax, limitMin, logarithmic, logarithmic, logistic, logistic, lognormal, lognormal, millisecond, minute, negativeBinomial, negativeBinomial, negativeBinomial, negativeBinomial, normal, normal, normal, normal, normal, normal, pareto, pareto, pareto, pert, pert, poisson, poisson, poisson, poisson, prepareBeforeExperimentStart_xjal, pulse, pulseTrain, quantum, ramp, randomFalse, randomFalse, randomTrue, randomTrue, rayleigh, rayleigh, rayleigh, second, setDefaultRandomGenerator, sqr, step, time, timeToDate, toDate, toDateInMillis, toLatitude, toLongitude, toTimeout, trace, traceln, traceln, traceln, triangular, triangular, triangular, triangular, triangular, uniform_discr, uniform_discr, uniform_discr, uniform_pos, uniform_pos, uniform, uniform, uniform, uniform, uniform, week, weibull, weibull, weibull, weibull, weibull, xidz, zidz |
| Methods inherited from class com.xj.anylogic.engine.Presentable |
contains, drawCollection, drawDatabase, drawDataset, drawExcelFile, drawFunction, drawHistogram2DData, drawHistogramData, drawInsert, drawKeyValueTable, drawModel, drawModelElements, drawPlainVariable, drawPresentation, drawQuery, drawShape, drawStatistics, drawTableFunction, drawTextFile, drawUpdate, executeShapeControlAction, executeShapeControlAction, executeShapeControlAction, executeShapeControlAction, executeShapeControlAction, executeShapeControlAction, finishReadObject_xjal, getExperiment, getNameOfShape, getPersistentShape, getShapeArcAngle, getShapeArcAngle, getShapeArcStartAngle, getShapeArcStartAngle, getShapeCADCustomLayerColors, getShapeCADDrawingAttributes, getShapeCADDrawingAttributes, getShapeCADFileName, getShapeCADFileName, getShapeCADVisibleLayerNames, getShapeChartColorFromDouble, getShapeChartDataColors, getShapeChartDataItems, getShapeChartDataPlotOptions, getShapeChartDataSets, getShapeChartDataTitles, getShapeChartHistogram2DOptions, getShapeChartHistogramOptions, getShapeChartHistograms, getShapeChartHistograms2D, getShapeChartProperties, getShapeControl, getShapeControl, getShapeControlDefaultValueBoolean, getShapeControlDefaultValueBoolean, getShapeControlDefaultValueDouble, getShapeControlDefaultValueDouble, getShapeControlDefaultValueInt, getShapeControlDefaultValueInt, getShapeControlDefaultValueString, getShapeControlDefaultValueString, getShapeControlManager, getShapeControlMaximum, getShapeControlMaximum, getShapeControlMinimum, getShapeControlMinimum, getShapeControlMultipleSelectionMode, getShapeControlMultipleSelectionMode, getShapeControlProgressString, getShapeControlProgressString, getShapeControlTexts, getShapeControlTexts, getShapeControlTexts2D, getShapeControlTexts2D, getShapeControlType, getShapeControlType, getShapeControlValueType, getShapeControlValueType, getShapeEmbeddedObject, getShapeEmbeddedObject, getShapeFillColor, getShapeFillColor, getShapeFont, getShapeFont, getShapeGroupContent, getShapeHeight, getShapeHeight, getShapeImageFileNames, getShapeImageFileNames, getShapeImageNumber, getShapeImageNumber, getShapeLineColor, getShapeLineColor, getShapeLineDx, getShapeLineDx, getShapeLineDy, getShapeLineDy, getShapeLineStyle, getShapeLineStyle, getShapeLineWidth, getShapeLineWidth, getShapeNPoints, getShapeNPoints, getShapePackagePrefix, getShapePointsDx, getShapePointsDx, getShapePointsDy, getShapePointsDy, getShapeRadiusX, getShapeRadiusX, getShapeRadiusY, getShapeRadiusY, getShapeReplication, getShapeRotation, getShapeScaleX, getShapeScaleX, getShapeScaleY, getShapeScaleY, getShapeText, getShapeText, getShapeTextAlignment, getShapeTextAlignment, getShapeType, getShapeWidth, getShapeWidth, getShapeX, getShapeY, getViewAreas, iconContains, isShapeCADNegative, isShapeCADNegative, isShapeClosed, isShapeClosed, isShapeControlEnabled, isShapeControlEnabled, isShapeControlVertical, isShapeControlVertical, isShapePublic, isShapeVisible, isShapeWithManualControlPoints, isShapeWithManualControlPoints, modelElementContains, modelElementContains, onClickIconAt, onClickModelAt, onClickPresentationAt, onItemRemoved, onSelectionChanged, onShapeClick, onShapeClickAt, onShapeGroupDraw, presentationContains, readCustomData, setControlValueToDefault, setControlValueToDefault, writeCustomData |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AgentContinuous3D
public AgentContinuous3D(Engine engine,
ActiveObject owner,
ActiveObjectCollection<?> collection)
getEnvironment
public EnvironmentContinuous3D getEnvironment()
- Description copied from class:
Agent
- Returns the environment where this agent belongs to.
- Overrides:
getEnvironment in class AgentContinuous
- Returns:
- the environment where this agent belongs to
connectTo
public void connectTo(AgentContinuous3D a)
- Creates a bi-directional connection between this agent and a given
other agent. Raises error if you try to connect to itself. Does
nothing if agents are already connected.
- Parameters:
a - another agent
getConnectedAgent
public AgentContinuous3D getConnectedAgent(int index)
- Description copied from class:
Agent
- Returns the connected agent with a given index.
- Overrides:
getConnectedAgent in class AgentContinuous
- Parameters:
index - the index of connection
- Returns:
- the connected agent with a given index
getConnections
public java.util.LinkedList<AgentContinuous3D> getConnections()
- Returns a collection of agents connected to this agent (bi-directionally),
or null if there have not been any connections yet. You should not
modify this collection.
- Overrides:
getConnections in class AgentContinuous
- Returns:
- collection of connected agents, or null
deliver
public void deliver(java.lang.Object msg,
AgentContinuous3D dest)
- Delivers a message to a given agent immediately during this method call.
If you wish this to happen in a separate event, use send() method.
- Parameters:
msg - a messagedest - the destination agent
send
public void send(java.lang.Object msg,
AgentContinuous3D dest)
- Sends a message to a given agent. The message will be delivered during
a separate event scheduled to occur in zero time after the current one.
If you are OK with the message delivered immediately during this event,
use deliver() method, which has better performance.
- Parameters:
msg - a messagedest - the destination agent
onReceive
public void onReceive(java.lang.Object msg,
AgentContinuous3D sender)
- A callback that is called when the agent receives a message
from another agent. Should be defined in a subclass if reaction is needed.
getZ
public double getZ()
- Returns the current (up-to-date) z coordinate of the agent in continuous space.
- Returns:
- the z coordinate in continuous space
stop
public void stop()
- Stops movement in continuous 3D, if any.
- Overrides:
stop in class AgentContinuous
setXY
@Deprecated
public void setXY(double x,
double y)
- Deprecated. this method is public only for easy translation of 2D models to 3D
and may be removed in future releases. Please use
setXYZ(double, double, double)
method instead
- Sets the X and Y coordinates of the agent location, doesn't
change Z coordinate. Is here for compatibility and should not
be used. Call
setXYZ(double, double, double) instead
- Parameters:
x - the x coordinate of the locationy - the y coordinate of the location
jumpTo
@Deprecated
public void jumpTo(double x,
double y)
- Deprecated. this method is public only for easy translation of 2D models to 3D
and may be removed in future releases. Please use
jumpTo(double, double, double)
method instead
- Instantly moves the agent to a given location without changes to Z-coordinate.
Terminates any movement.
Doesn't call "on arrival" code
- Parameters:
x - the x coordinate of the new locationy - the y coordinate of the new location
jumpTo
public void jumpTo(double x,
double y,
double z)
- Instantly moves the agent to a given location.
Terminates any movement.
Doesn't call "on arrival" code
- Parameters:
x - the x coordinate of the new locationy - the y coordinate of the new locationz - the z coordinate of the new location
moveTo
@Deprecated
public void moveTo(double x,
double y)
- Deprecated. this method is public only for easy translation of 2D models to 3D
and may be removed in future releases. Please use
moveTo(double, double, double)
method instead
- Starts movement in the direction of the given target location in continuous 3D space.
Z coordinate of target is the same as the current agent's Z coordinate.
"On arrival" code is executed when movement is finished.
- Parameters:
x - the x coordinate of the target locationy - the y coordinate of the target location
moveTo
public void moveTo(double x,
double y,
double z)
- Starts movement in the direction of the given target location in continuous 3D.
"On arrival" code is executed when movement is finished.
- Parameters:
x - the x coordinate of the target locationy - the y coordinate of the target locationz - the z coordinate of the target location
moveTo
@Deprecated
public void moveTo(double x,
double y,
Path2D path)
- Deprecated. this method is public only for easy translation of 2D models to 3D
and may be removed in future releases. Please use
moveTo(double, double, double, Path3D)
method instead
- Starts movement in the direction of the given target location in
continuous 3D space along a given path.
Z coordinate of target (and path points) is the same as the current
agent's Z coordinate.
If the agent is currently not on the path, it will first move to
the closest point on the path.
If the target is not on the path, the agent will move along the path
to the point closest to the target, and then move to the target.
"On arrival" code is executed when movement is finished.
- Parameters:
x - the x coordinate of the target locationy - the y coordinate of the target locationpath - the polyline along which the agent will move
moveTo
public void moveTo(double x,
double y,
double z,
Path3D path)
- Starts movement in the direction of the given target location in
continuous 3D space along a given path. If the agent is currently
not on the path, it will first move to the closest point on the path.
If the target is not on the path, the agent will move along the path
to the point closest to the target, and then move to the target.
"On arrival" code is executed when movement is finished.
- Parameters:
x - the x coordinate of the target locationy - the y coordinate of the target locationz - the z coordinate of the target locationpath - the polyline along which the agent will move
moveToNearestAgent
public void moveToNearestAgent(java.lang.Iterable<? extends AgentContinuous> agents)
- Description copied from class:
AgentContinuous
- Starts movement to the nearest agent from the given collection.
Stops any current movement.
- Overrides:
moveToNearestAgent in class AgentContinuous
- Parameters:
agents - the collection of agents
setRotation
public void setRotation(double rotation)
- Sets the horizontal rotation (angle in radians) of the agent animation in continuous 3D
space. This rotation will be overridden during the next call of moveTo() or
during current movement (if any exists) along polyline. If rotation is not
intended to be changed, use
setRotation(double, boolean) method
with the second parameter set to true.
- Parameters:
rotation - the horizontal rotation angle of the agent in radians- See Also:
setRotation(double, boolean),
setRotation(double, double, boolean)
setRotation
public void setRotation(double rotation,
boolean freezeRotation)
- Sets the horizontal rotation (angle in radians) of the agent animation in continuous 3D
space.
- Parameters:
rotation - the horizontal rotation angle of the agent in radiansfreezeRotation - if true, rotation (horizontal and vertical)
will not be changed by moveTo(double, double) calls- See Also:
AgentContinuous.isRotationFrozen(),
setRotation(double, double, boolean)
setRotation
public void setRotation(double rotation,
double verticalRotation)
- Sets the rotations (angles in radians) of the agent animation in continuous 3D
space. These rotations will be overridden during the next call of moveTo() or
during current movement (if any exists) along polyline. If rotations are not
intended to be changed, use
setRotation(double, double, boolean) method
with the third parameter set to true.
- Parameters:
rotation - the rotation angle of the agent in radiansverticalRotation - the vertical rotation of (already rotated horizontally) agent
around Y axis (CW from +Z to +X)- See Also:
setRotation(double, double, boolean)
setRotation
public void setRotation(double rotation,
double verticalRotation,
boolean freezeRotation)
- Sets the rotations (angles in radians) of the agent animation in continuous 3D
space.
- Parameters:
rotation - the rotation angle of the agent in radians in the horizontal planeverticalRotation - the vertical rotation of (already rotated horizontally) agent
around Y axis (CW from +Z to +X)freezeRotation - if true, rotation will not be changed by
moveTo(double, double) calls- See Also:
AgentContinuous.isRotationFrozen()
getRotation
public double getRotation()
- Returns the current horizontal rotation angle (in radians) of the agent in
continuous 3D space or GIS space. If rotation is not frozen (see
AgentContinuous.isRotationFrozen(), setRotation(double, double, boolean)),
the rotation changes each time the agent starts moving and also changes
multiple times during movement along polyline.
- Overrides:
getRotation in class AgentContinuous
- Returns:
- the current rotation of the agent in radians (measured from
-Y axis direction to +X axis direction around (0, 0) point)
getVerticalRotation
public double getVerticalRotation()
- Returns the current vertical rotation angle of the agent in
continuous 3D space. If rotation is not frozen (see
AgentContinuous.isRotationFrozen(), setRotation(double, double, boolean)),
the rotation changes each time the agent starts moving and also changes
multiple times during movement along polyline.
- Returns:
- the current rotation of the agent in radians
around Y axis (CW from +Z to +X)
getTargetX
public double getTargetX()
- Description copied from class:
AgentContinuous
- Returns the x of the target location if moving, otherwise current x in
continuous 2D space or GIS space.
In case of GIS environment this is the longitude,
measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)
- Overrides:
getTargetX in class AgentContinuous
- Returns:
- the x of the target location if moving, otherwise current x
getTargetY
public double getTargetY()
- Description copied from class:
AgentContinuous
- Returns the y of the target location if moving, otherwise current y in
continuous 2D space or GIS space.
In case of GIS environment this is the latitude,
measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
- Overrides:
getTargetY in class AgentContinuous
- Returns:
- the y of the target location if moving, otherwise current y
getTargetZ
public double getTargetZ()
- Returns the z of the target location if moving, otherwise current z in
continuous 3D space.
- Returns:
- the z of the target location if moving, otherwise current z
setXYZ
public void setXYZ(double x,
double y,
double z)
- Sets the coordinates of the agent location in continuous 3D space.
Should only be used to initialize the agent location.
Assumes the agent is not moving.
If the agent is not in continuous 3D space, does nothing.
- Parameters:
x - the x coordinate of the locationy - the y coordinate of the locationz - the z coordinate of the location
distanceTo
public double distanceTo(Agent other)
- Calculates the distance from this agent to another one in continuous 3D space.
- Specified by:
distanceTo in class AgentContinuous
- Parameters:
other - another agent
- Returns:
- the distance to the other agent
distanceTo
@Deprecated
public double distanceTo(double x,
double y)
- Deprecated. this method is public only for easy translation of 2D models to 3D
and may be removed in future releases. Please use
distanceTo(double, double, double)
method instead
- Calculates the distance from this agent to a given point in the
projection to the horizontal plane (i.e. agent's Z coordinate isn't
used in the calculation).
- Parameters:
x - the x coordinate of the pointy - the y coordinate of the point
- Returns:
- the distance of Agent's projection (on the plane Z=0) to the point (x,y)
distanceTo
public double distanceTo(double x,
double y,
double z)
- Calculates the distance from this agent to a given point in continuous 3D space.
- Parameters:
x - the x coordinate of the pointy - the y coordinate of the pointz - the z coordinate of the point
- Returns:
- the distance to the point (x,y,z)
Copyright © 1991-2008 XJ Technlogies. All Rights Reserved.