com.xj.anylogic.engine
Class ActiveObject

java.lang.Object
  extended by com.xj.anylogic.engine.Presentable
      extended by com.xj.anylogic.engine.Utilities
          extended by com.xj.anylogic.engine.ActiveObject
All Implemented Interfaces:
com.xj.anylogic.engine.internal.Child, java.io.Serializable
Direct Known Subclasses:
Agent

public class ActiveObject
extends Utilities
implements com.xj.anylogic.engine.internal.Child

This is a base class for all active object classes created by the user. Active object is the main building block of AnyLogic models; it can have parameters, variables, ports, events, statecharts and embedded active objects. Active object is the unit of dynamic creation of destruction.
Memory:
sizeof(Object) + 20 bytes = 28 bytes
+ sizeof(HashSet for all active dynamic events)

Author:
XJ Technologies Company Ltd. www.anylogic.com
See Also:
Serialized Form

Field Summary
static int DRAW_PARAMETER_DYNAMIC
           
static int DRAW_SD_ARRAY
          if set, the array brackets are drawn around the shape
static int DRAW_SD_CONSTANT
           
static int DRAW_SD_EXTERNAL
           
static int DRAW_SD_LINK_DELAY
           
static int DRAW_SD_LINK_INITIAL
           
static int DRAW_SD_NEGATIVE
           
static int DRAW_SD_NO_SOURCE
           
static int DRAW_SD_NO_TARGET
           
static int DRAW_SD_PUBLIC_ONLY
           
static int DRAW_SD_SHADOW
           
static int DRAW_SD_ZERO
           
static int EVENT_TIMEOUT_MODE_CYCLIC
           
static int EVENT_TIMEOUT_MODE_ONCE
           
static int 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
 
Constructor Summary
ActiveObject(Engine engine, ActiveObject owner, ActiveObjectCollection<?> collection)
          Constructs the active object, sets up its owner and list (if replicated).
 
Method Summary
 void assignInitialConditions_xjal()
          This method shouldn't be normally called by user.
 void create()
          Creates the active object embedded objects; also calls user's onCreate() at the end.
 void drawActionChart(Panel panel, java.awt.Graphics2D g, int x, int y, int width, int height, int xname, int yname, java.lang.String name, java.awt.Color fillColor)
          Draws an action chart image and its name at the given positions.
 void drawActionChartLink(Panel panel, java.awt.Graphics2D g, int x, int yStart, int yEnd)
          Draws an action chart link at the given positions.
 void drawAuxiliaryVariable(Panel panel, java.awt.Graphics2D g, int x, int y, int xname, int yname, java.lang.String name, java.lang.Object aux, boolean constant, boolean external, boolean shadow)
          Deprecated. will be removed in next release. Use drawAuxiliaryVariable(Panel, Graphics2D, int, int, int, int, String, Object, Color, int)
 void drawAuxiliaryVariable(Panel panel, java.awt.Graphics2D g, int x, int y, int xname, int yname, java.lang.String name, java.lang.Object aux, java.awt.Color color, int drawingAttributes)
          Draws an auxiliary variable image and its name at the given positions and displays the variable value underneath the name.
 void drawBranchExit(Panel panel, java.awt.Graphics2D g, int[] x, int[] y, int xname, int yname, java.lang.String name)
          Draws a statechart branch exit (pseudotransition) and its name at the given position.
 void drawBranchState(Panel panel, java.awt.Graphics2D g, int x, int y, int xname, int yname, java.lang.String name, short state)
          Draws a statechart branch pseudostate and its name at the given position.
static void drawBreakBlock(Panel panel, java.awt.Graphics2D g, int x, int y, int width, int height, boolean continueOrBreak, java.awt.Color fillColor)
          Draws the action chart Brake/Continue Loop block shape.
static void drawCausalLoop(Panel panel, java.awt.Graphics2D g, int x, int y, boolean clockwise, java.awt.Color color, java.lang.String type, java.lang.String text)
          Draws a causal loop icon
 void drawCodeBlock(Panel panel, java.awt.Graphics2D g, int x, int y, int width, int height, java.lang.String text, boolean comment, java.awt.Color fillColor)
          Draws an action chart Code block image at the given positions.
 void drawConnector(Panel panel, java.awt.Graphics2D g, int[] x, int[] y, boolean variablesConnector)
          Draws a port or variable connector
 void drawDecisionBlock(Panel panel, java.awt.Graphics2D g, int x, int y, int width, int height, java.lang.String text, boolean comment, java.awt.Color fillColor, boolean isTruePoint, int trueX, int trueY, boolean isFalsePoint, int falseX, int falseY, int areaHeight, int appearance)
          Draws an action chart Decision block image at the given positions.
 void drawDynamicEvent(Panel panel, java.awt.Graphics2D g, int x, int y, int xname, int yname, java.lang.String name, java.lang.Class<?> c)
          Draws a dynamic event image and its (class) name at the given positions.
 void drawEmbeddedObjectModel(Panel panel, java.awt.Graphics2D g, int x, int y, int xname, int yname, java.lang.String name, ActiveObject embeddedObject)
          Draws a non-replicated embedded object icon part at the given position.
 void drawEmbeddedObjectModel(Panel panel, java.awt.Graphics2D g, int x, int y, int xname, int yname, java.lang.String name, ActiveObjectCollection<?> embeddedObjectList)
          Draws a replicated embedded object icon part at the given position.
 void drawEmbeddedObjectModelDefault(Panel panel, java.awt.Graphics2D g, int x, int y, int xname, int yname, java.lang.String name, ActiveObject embeddedObject)
          Draws a non-replicated object default icon at the given position.
 void drawEmbeddedObjectModelDefault(Panel panel, java.awt.Graphics2D g, int x, int y, int xname, int yname, java.lang.String name, ActiveObjectCollection<?> embeddedObjectList)
          Draws a replicated embedded object default icon at the given position.
 void drawEnvironment(Panel panel, java.awt.Graphics2D g, int x, int y, int xname, int yname, java.lang.String name, Environment<?> env)
           
 void drawEvent(Panel panel, java.awt.Graphics2D g, int x, int y, int xname, int yname, java.lang.String name, Event e)
          Draws an event image and its name at the given positions.
 void drawFinalState(Panel panel, java.awt.Graphics2D g, int x, int y, int xname, int yname, java.lang.String name, short state, Statechart statechart)
          Draws a statechart branch state and its name at the given position.
 void drawFlow(Panel panel, java.awt.Graphics2D g, int[] pointsX, int[] pointsY, int valveX, int valveY, float valveAngle, int xname, int yname, java.lang.String name, java.lang.Object flow, java.awt.Color color, int drawingAttributes)
          Draws a flow image and its name at the given positions and displays the flow value underneath the name.
 void drawFlow(Panel panel, java.awt.Graphics2D g, int x, int y, int xname, int yname, java.lang.String name, java.lang.Object flow, boolean constant, boolean external, boolean shadow)
          Deprecated. This method is no more supported and will be removed in next release. Use drawFlow(Panel, Graphics2D, int[], int[], int, int, float, int, int, String, Object, Color, int)
static void drawFlowStockDependencyLine(Panel panel, java.awt.Graphics2D g, int xstart, int ystart, int xend, int yend, java.awt.Color color)
          Deprecated. This method is no more supported and will be removed in next release.
 void drawHistoryState(Panel panel, java.awt.Graphics2D g, int x, int y, int xname, int yname, java.lang.String name, short state, boolean deep)
          Draws a statechart history pseudostate and its name at the given position.
 void drawInitialStatePointer(Panel panel, java.awt.Graphics2D g, int xstart, int ystart, int xend, int yend)
          Draws an initial state pointer at the given position.
static void drawLink(Panel panel, java.awt.Graphics2D g, java.awt.geom.Arc2D.Double arc, java.awt.Color color, int lineWidth, java.lang.String polarity, float polarityPosition, int drawingAttributes)
          Draws a link as arc with arrow.
static void drawLink(Panel panel, java.awt.Graphics2D g, int xstart, int ystart, int xend, int yend, java.awt.Color color, int lineWidth, java.lang.String polarity, float polarityPosition, int drawingAttributes)
          Draws a link as arrowline.
 void drawLocalVariable(Panel panel, java.awt.Graphics2D g, int x, int y, int width, int height, java.lang.String text, boolean comment, java.awt.Color fillColor)
          Draws an action chart Local Variable block image at the given positions.
 void drawLoopArea(Panel panel, java.awt.Graphics2D g, int x, int y, int width, int height)
          Draws the action chart loop area shape at the given positions.
 void drawLoopBlock(Panel panel, java.awt.Graphics2D g, int x, int y, int width, int height, java.lang.String text, boolean comment, java.awt.Color fillColor)
          Draws an action chart Loop block image at the given positions.
 void drawParameter(Panel panel, java.awt.Graphics2D g, int x, int y, int xname, int yname, java.lang.String name, java.lang.Object param, boolean dynamic, boolean array)
          Deprecated. will be removed in next release. Use drawParameter(Panel, Graphics2D, int, int, int, int, String, Object, int)
 void drawParameter(Panel panel, java.awt.Graphics2D g, int x, int y, int xname, int yname, java.lang.String name, java.lang.Object param, int drawingAttributes)
          Draws a parameter image and ins name at the given positions and displays the parameter toString text underneath the name.
static void drawPlainDependencyArc(Panel panel, java.awt.Graphics2D g, java.awt.geom.Arc2D.Double arc, java.awt.Color color)
          Deprecated. will be removed in next release. Use drawLink(Panel, Graphics2D, java.awt.geom.Arc2D.Double, Color, int, String, float, int)
static void drawPlainDependencyLine(Panel panel, java.awt.Graphics2D g, int xstart, int ystart, int xend, int yend, java.awt.Color color)
          Deprecated. will be removed in next release. Use drawLink(Panel, Graphics2D, int, int, int, int, Color, int, String, float, int)
 void drawPort(Panel panel, java.awt.Graphics2D g, int x, int y, int xname, int yname, java.lang.String name, Port<?,?> port)
          Draws a port at the given position.
 void drawReturnBlock(Panel panel, java.awt.Graphics2D g, int x, int y, int width, int height, java.lang.String text, boolean comment, java.awt.Color fillColor)
          Draws an action chart Return block image at the given positions.
 void drawSchedule(Panel panel, java.awt.Graphics2D g, int x, int y, int xname, int yname, java.lang.String name, Schedule<?> s)
          Draws a schedule image and its name at the given positions.
 void drawState(Panel panel, java.awt.Graphics2D g, int x, int y, int width, int height, int xname, int yname, java.lang.String name, java.awt.Color color, short state, Statechart statechart)
          Draws a statechart state and its name at the given position.
 void drawStatechartEntryPoint(Panel panel, java.awt.Graphics2D g, int xstart, int ystart, int xend, int yend, int xname, int yname, java.lang.String name, Statechart statechart)
          Draws a statechart entry point and the statechart name at the given position.
 void drawStock(Panel panel, java.awt.Graphics2D g, int x, int y, int width, int height, int xname, int yname, java.lang.String name, java.lang.Object stock, java.awt.Color color, int drawingAttributes)
          Draws a stock image and its name at the given positions and displays the stock value underneath the name.
 void drawStock(Panel panel, java.awt.Graphics2D g, int x, int y, int xname, int yname, java.lang.String name, java.lang.Object stock, boolean shadow)
          Deprecated. will be removed in next release. Use drawStock(Panel, Graphics2D, int, int, int, int, int, int, String, Object, Color, int)
 void drawTransition(Panel panel, java.awt.Graphics2D g, int[] x, int[] y, int xname, int yname, java.lang.String name, Transition tr)
          Draws a statechart transition and its name at the given position.
 void enterState(short state, boolean destination)
          Executes entry action of the state and starts the transitions outgoing the state.
 java.lang.RuntimeException error(java.lang.String errorText)
          Signals an error during the model run by throwing a RuntimeException with errorText preceded by the active object full name.
 double evaluateRateOf(EventRate e)
          Evaluates the rate expression of a rate event.
 double evaluateRateOf(TransitionRate t)
          Evaluates the rate expression of a rate transition.
 double evaluateTimeoutOf(EventTimeout e)
          Evaluates timeout expression of a timeout event.
 double evaluateTimeoutOf(TransitionTimeout t)
          Evaluates timeout expression of a timeout transition.
 void executeActionOf(EventCondition e)
          Executes action of a condition event.
 void executeActionOf(EventRate e)
          Executes action of a rate event.
 void executeActionOf(EventTimeout e)
          Executes action of a timeout event.
 void executeActionOf(Statechart s)
          Executes startup action of a statechart: calls actions of the statechart entry point, entry action of initial states, starts the corresponding transitions, etc., and sets up the initially active simple state.
 void executeActionOf(TransitionCondition t)
          Executes action of a condition transition.
 void executeActionOf(TransitionMessage t, int msg)
          Executes action of a message transition for int message type - depends on the message.
 void executeActionOf(TransitionMessage t, java.lang.Object msg)
          Executes action of a message transition for Object message type - depends on the message.
 void executeActionOf(TransitionRate t)
          Executes action of a rate transition.
 void executeActionOf(TransitionTimeout t)
          Executes action of a timeout transition.
 boolean executeOnReceiveActionOf(Port<?,?> p, java.lang.Object msg)
          Executes action code associated with a message being received at a port.
 boolean executeOnSendActionOf(Port<?,?> p, java.lang.Object msg)
          Executes action associated with a message being sent via a port.
 void exitInnerStates(short state, Statechart statechart)
          Calls ExitState() for all states inside state from the currently active simple state up to to state (not including state).
 void exitState(short state, Transition t, boolean source, Statechart statechart)
          Cancels all transitions outgoing the state (if source is true, except for t which is being taken and does not need to be canceled) and executes the state exit action.
 boolean finishSimulation()
          Engine command applicable only in RUNNING or PAUSED state (in other states does nothing and returns false).
 void formulasExecute_xjal()
          This method shouldn't be normally called by user.
 int getCameras3D(java.util.Map<java.lang.String,Camera3D> output)
          Adds all Camera3D of this active object to the given map output, if it is not null.
 short getContainerStateOf(short state)
          Returns the immediate container state of a given state or -1 if the state is at the topmost level (has no container state).
 java.util.Set<DynamicEvent> getDynamicEvents()
          Returns the set of all currently existing dynamic events of this active object.
 java.util.List<java.lang.Object> getEmbeddedObjects()
          Creates and returns a list of embedded objects if there are any, null if there are none.
 Engine getEngine()
          Returns the simulation engine where this object belongs to.
 double getFirstOccurrenceTime(EventTimeout e)
          Returns the (absolute) time of first occurrence of a timeout event (of Once or Cyclic mode).
 java.lang.String getFullName()
          Returns the name of the active object prefixed by the path from the root object to this one.
 int getIndex()
          For a list-based replicated active object, returns its index in the list, otherwise returns -1.
 ActiveObjectIntegrationManager getIntegrationManager_xjal()
          This method shouldn't be normally called by user.
 int getModeOf(EventTimeout e)
          Returns mode of a timeout event: Cyclic, Once, User.
 java.lang.String getName()
          Returns the name of this active object, i.e. the name of its instance in the owner object, with the index in square brackets for replicated objects.
 java.lang.String getNameOf(ActiveObject ao)
          Returns the name of a simple (not replicated) embedded object.
 java.lang.String getNameOf(ActiveObjectCollection<?> aocollection)
          Returns the name of a replicated embedded object.
 java.lang.String getNameOf(EventCondition e)
          Returns the name of a condition event.
 java.lang.String getNameOf(EventRate e)
          Returns the name of a rate event.
 java.lang.String getNameOf(EventTimeout e)
          Returns the name of a timeout event.
 java.lang.String getNameOf(Port<?,?> p)
          Returns the name of a port.
 java.lang.String getNameOf(Statechart s)
          Returns the name of a statechart.
 java.lang.String getNameOf(TransitionCondition t)
          Returns the name of a condition transition.
 java.lang.String getNameOf(TransitionMessage t)
          Returns the name of a message transition.
 java.lang.String getNameOf(TransitionRate t)
          Returns the name of a rate transition.
 java.lang.String getNameOf(TransitionTimeout t)
          Returns the name of a timeout transition.
 java.lang.String getNameOfState(short state)
          Returns the name of a statechart state.
 ActiveObject getOwner()
          Returns the owner active object that encapsulates this one, null if this is the root object in the model.
 ShapeEmbeddedObjectPresentation getOwnerShape()
          Returns the shape on owner's presentation, this object presentation belongs to
 Presentation getPresentation()
          Returns the presentation object of the model, or null if there is none.
 ActiveObjectCollection<?> getReplicatedCollection()
          For a replicated object returns the Collection of active objects embedded in the owner object where this active object belongs to, null if the object is not replicated.
 ActiveObjectList<?> getReplicatedList()
          For a list-based replicated object returns the List of active objects embedded in the owner object where this active object belongs to, null if the object is not replicated
 void getScalarPhaseVector_xjal(double[] D, double[] A)
          This method shouldn't be normally called by user.
 void getScalarPhaseVectorForInitialConditions_xjal(double[] D, double[] A)
          This method shouldn't be normally called by user.
 void getScalarRightPart_xjal(double[] DR, double[] AR)
          This method shouldn't be normally called by user.
 void getScalarRightPartForInitialConditions_xjal(double[] DR, double[] AR)
          This method shouldn't be normally called by user.
 Statechart getStatechartOf(TransitionCondition t)
          Returns the statechart where the condition transition belongs to.
 Statechart getStatechartOf(TransitionMessage t)
          Returns the statechart where the message transition belongs to.
 Statechart getStatechartOf(TransitionRate t)
          Returns the statechart where the rate transition belongs to.
 Statechart getStatechartOf(TransitionTimeout t)
          Returns the statechart where the timeout transition belongs to.
 boolean isReplicated()
          Returns true if this object is embedded in its owner as replicated, i.e. as a member of a list of objects.
 void nothingChanged()
          If called during an event execution, prevents the engine from calling onChange() of the active object that originated the event.
 void onChange()
          Notification to the active object meaning "some of your data may have changed during this event".
 void onCreate()
          Is called at the very end of create() method, i.e. when all parameters have been initialized, embedded objects are created (and their onCreate() has been called), but before any activities are started (no events are scheduled yet), thus also before the startup code is executed.
 void onDestroy()
          Must be called when the active object is dynamically disposed.
 void onStartup()
          Is called after all activities are started in the object (initial events are scheduled) and onStartup() has been called for the embedded objects, but before any steps are made.
 boolean pauseSimulation()
          Engine command applicable only in RUNNING state (in other states does nothing and returns false).
 void putScalarPhaseVector_xjal(double[] D, double[] A)
          This method shouldn't be normally called by user.
 void putScalarPhaseVectorForInitialConditions_xjal(double[] D, double[] A)
          This method shouldn't be normally called by user.
 void restoreOwner(java.lang.Object owner)
          This method normally should not be called by user
This method restores owner of this object
The method is used in snapshot saving/loading
 boolean runSimulation()
          Engine command applicable only in PAUSED state (in other states does nothing and returns false).
 void setDestroyed()
          Marks this object as subject to destruction after the current step is finished.
 void setEngine(Engine engine)
          Sets the simulation engine for the object.
 void setOwnerShape_xjal(ShapeEmbeddedObjectPresentation ownerShape)
          This method shouldn't be called by user.
 void setParametersToDefaultValues()
          Sets all not dynamic parameters to their default values.
static void setupPlainDependencyArc(java.awt.geom.Arc2D.Double arc, double xstart, double ystart, double xend, double yend, double height)
          Deprecated. this method is deprecated and will be removed in the next release
 void start()
          Starts activities (e.g. schedules initial events) in this active object: events, statecharts and embedded objects, submits equations.
 boolean stateContainsState(short compstate, short simpstate)
          Checks if one state of a statechart contains another (deep contents - inside contained composite states - are also checked).
 boolean stopSimulation()
          Engine command applicable only in any non-IDLE state (in IDLE state does nothing and returns false).
 boolean testConditionOf(EventCondition e)
          Tests the condition expression of a condition event.
 boolean testConditionOf(TransitionCondition t)
          Tests the condition expression of a transition event.
 boolean testGuardOf(TransitionCondition t)
          Tests the guard expression of a condition transition.
 boolean testGuardOf(TransitionMessage t)
          Tests the guard expression of a message transition.
 boolean testGuardOf(TransitionRate t)
          Tests the guard expression of a rate transition.
 boolean testGuardOf(TransitionTimeout t)
          Tests the guard expression of a timeout transition.
 boolean testMessageOf(TransitionMessage t, java.lang.Object msg)
          Tests the message received by the statechart against the trigger description of a message transition - for Object message type.
 java.lang.String toString()
          Returns a (possibly, multi-line) textual information on the active object.
 
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, getShapeRotation, getShapeScaleX, getShapeScaleX, getShapeScaleY, getShapeScaleY, getShapeText, getShapeText, getShapeTextAlignment, getShapeTextAlignment, getShapeType, getShapeWidth, getShapeWidth, getShapeX, getShapeX, getShapeY, 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
 

Field Detail

EVENT_TIMEOUT_MODE_CYCLIC

public static final int EVENT_TIMEOUT_MODE_CYCLIC
See Also:
Constant Field Values

EVENT_TIMEOUT_MODE_ONCE

public static final int EVENT_TIMEOUT_MODE_ONCE
See Also:
Constant Field Values

EVENT_TIMEOUT_MODE_USER

public static final int EVENT_TIMEOUT_MODE_USER
See Also:
Constant Field Values

DRAW_SD_SHADOW

public static final int DRAW_SD_SHADOW
See Also:
Constant Field Values

DRAW_SD_CONSTANT

public static final int DRAW_SD_CONSTANT
See Also:
Constant Field Values

DRAW_SD_EXTERNAL

public static final int DRAW_SD_EXTERNAL
See Also:
Constant Field Values

DRAW_SD_NO_SOURCE

public static final int DRAW_SD_NO_SOURCE
See Also:
Constant Field Values

DRAW_SD_NO_TARGET

public static final int DRAW_SD_NO_TARGET
See Also:
Constant Field Values

DRAW_SD_ARRAY

public static final int DRAW_SD_ARRAY
if set, the array brackets are drawn around the shape

See Also:
Constant Field Values

DRAW_SD_NEGATIVE

public static final int DRAW_SD_NEGATIVE
See Also:
Constant Field Values

DRAW_SD_ZERO

public static final int DRAW_SD_ZERO
See Also:
Constant Field Values

DRAW_SD_LINK_INITIAL

public static final int DRAW_SD_LINK_INITIAL
See Also:
Constant Field Values

DRAW_SD_LINK_DELAY

public static final int DRAW_SD_LINK_DELAY
See Also:
Constant Field Values

DRAW_SD_PUBLIC_ONLY

public static final int DRAW_SD_PUBLIC_ONLY
See Also:
Constant Field Values

DRAW_PARAMETER_DYNAMIC

public static final int DRAW_PARAMETER_DYNAMIC
See Also:
Constant Field Values
Constructor Detail

ActiveObject

public ActiveObject(Engine engine,
                    ActiveObject owner,
                    ActiveObjectCollection<?> collection)
Constructs the active object, sets up its owner and list (if replicated). Should not create any embedded objects: parameters must be set by the owner after construction and only then create() should be called.

Parameters:
engine - the simulation engine
owner - owner active object that encapsulates this one, or null if this is root
collection - collection of replicated objects where this object belongs to or null if not replicated
Method Detail

setEngine

public void setEngine(Engine engine)
Sets the simulation engine for the object. Is needed when a default constructor is invoked.

Parameters:
engine - the simulation engine that will handle this object

getEngine

public Engine getEngine()
Returns the simulation engine where this object belongs to.

Specified by:
getEngine in class Presentable
Returns:
the simulation engine.

getPresentation

public Presentation getPresentation()
Description copied from class: Presentable
Returns the presentation object of the model, or null if there is none.

Specified by:
getPresentation in class Presentable
Returns:
the presentation object of the model, or null

getName

public java.lang.String getName()
Returns the name of this active object, i.e. the name of its instance in the owner object, with the index in square brackets for replicated objects. For the root object returns "root".

Returns:
the short name of the object not including path from root

getFullName

public java.lang.String getFullName()
Returns the name of the active object prefixed by the path from the root object to this one.

Returns:
the full name of the object including path from root

toString

public java.lang.String toString()
Returns a (possibly, multi-line) textual information on the active object. By default returns its full name, but mat be overridden in subclasses.

Overrides:
toString in class java.lang.Object
Returns:
the textual info on the active object

error

public java.lang.RuntimeException error(java.lang.String errorText)
Description copied from class: Utilities
Signals an error during the model run by throwing a RuntimeException with errorText preceded by the active object full name.

Specified by:
error in class Utilities
Parameters:
errorText - the text describing the error that will be displayed.
Returns:
actually this method never returns, it throws runtime exception by itself.
But the return type is defined for some cases when you would like to use the following form of call: throw error("my message");

getOwner

public ActiveObject getOwner()
Returns the owner active object that encapsulates this one, null if this is the root object in the model.

Returns:
owner active object or null

getOwnerShape

public ShapeEmbeddedObjectPresentation getOwnerShape()
Returns the shape on owner's presentation, this object presentation belongs to

Returns:
the shape on owner's presentation, this object presentation belongs to

setOwnerShape_xjal

public void setOwnerShape_xjal(ShapeEmbeddedObjectPresentation ownerShape)
This method shouldn't be called by user.
It is public due to technical reasons


getEmbeddedObjects

public java.util.List<java.lang.Object> getEmbeddedObjects()
Creates and returns a list of embedded objects if there are any, null if there are none. For a replicated object its list is included in the result, not each object, therefore the resulting list contains either instances of ActiveObject or of ActiveObjectCollection<? extends ActiveObject>
This function must be implemented in a subclass if there is at least one embedded object.

Returns:
the newly created list of all embedded objects, or null

isReplicated

public boolean isReplicated()
Returns true if this object is embedded in its owner as replicated, i.e. as a member of a list of objects.

Returns:
true if this object is replicated, false otherwise.

getIndex

public int getIndex()
For a list-based replicated active object, returns its index in the list, otherwise returns -1. Current implementation is very inefficient (linear complexity) and will be changed!

Returns:
index of this object in the replicated list or -1
Throws:
java.lang.RuntimeException - if replicated object is not list-based.

getReplicatedList

public ActiveObjectList<?> getReplicatedList()
For a list-based replicated object returns the List of active objects embedded in the owner object where this active object belongs to, null if the object is not replicated

Returns:
the List where this object belongs to, or null
Throws:
java.lang.RuntimeException - if replicated object is not list-based.
See Also:
getReplicatedCollection()

getReplicatedCollection

public ActiveObjectCollection<?> getReplicatedCollection()
For a replicated object returns the Collection of active objects embedded in the owner object where this active object belongs to, null if the object is not replicated.

Returns:
the Collection where this object belongs to, or null
See Also:
getReplicatedList()

onCreate

public void onCreate()
Is called at the very end of create() method, i.e. when all parameters have been initialized, embedded objects are created (and their onCreate() has been called), but before any activities are started (no events are scheduled yet), thus also before the startup code is executed. By default this method does nothing, but can be defined by the user.


onStartup

public void onStartup()
Is called after all activities are started in the object (initial events are scheduled) and onStartup() has been called for the embedded objects, but before any steps are made. By default this method does nothing, but can be defined by the user by filling out the startup code section.


onChange

public void onChange()
Notification to the active object meaning "some of your data may have changed during this event". Causes:
1. Re-evaluation of conditions in events and statechart transitions with Condition triggers
2. Re-calculation of rates in events and statechart transitions with Rate triggers
By default this method is called if the active object originates an event or if a message is received by one of its ports. This can be prevented by calling nothingChanged().
You can also manually call this function if you wish some active obejct to notice the change even if it had no events.


nothingChanged

public void nothingChanged()
If called during an event execution, prevents the engine from calling onChange() of the active object that originated the event. Has effect only within one event. Does not affect other active objects where the user may have manually called onChange() or it may have got called by ports, etc.


getDynamicEvents

public java.util.Set<DynamicEvent> getDynamicEvents()
Returns the set of all currently existing dynamic events of this active object. The user should not change this set.

Returns:
the set of active dynamic events

getNameOf

public java.lang.String getNameOf(EventTimeout e)
Returns the name of a timeout event.
Must be implemented in a subclass if there are any timeout events.

Parameters:
e - the event
Returns:
event name

getModeOf

public int getModeOf(EventTimeout e)
Returns mode of a timeout event: Cyclic, Once, User.
Must be implemented in a subclass if there are any timeout events.

Parameters:
e - the event
Returns:
event mode

getFirstOccurrenceTime

public double getFirstOccurrenceTime(EventTimeout e)
Returns the (absolute) time of first occurrence of a timeout event (of Once or Cyclic mode). Must be implemented in a subclass if there are any such timeout events.

Parameters:
e - the event
Returns:
the time of first occurrence, 0 by default

evaluateTimeoutOf

public double evaluateTimeoutOf(EventTimeout e)
Evaluates timeout expression of a timeout event.
Must be implemented in a subclass if there are any timeout events.

Parameters:
e - the event
Returns:
the timeout value

executeActionOf

public void executeActionOf(EventTimeout e)
Executes action of a timeout event.
Implementation in a subclass can be skipped if the action(s) are empty.

Parameters:
e - the event

getNameOf

public java.lang.String getNameOf(EventRate e)
Returns the name of a rate event.
Must be implemented in a subclass if there are any rate events.

Parameters:
e - the event
Returns:
event name

evaluateRateOf

public double evaluateRateOf(EventRate e)
Evaluates the rate expression of a rate event.
Must be implemented in a subclass if there are any rate events.

Parameters:
e - the event
Returns:
the rate value

executeActionOf

public void executeActionOf(EventRate e)
Executes action of a rate event.
Implementation in a subclass can be skipped if the action(s) are empty.

Parameters:
e - the event

getNameOf

public java.lang.String getNameOf(EventCondition e)
Returns the name of a condition event.
Must be implemented in a subclass if there are any condition events.

Parameters:
e - the event
Returns:
event name

testConditionOf

public boolean testConditionOf(EventCondition e)
Tests the condition expression of a condition event.
Must be implemented in a subclass if there are any condition events.

Parameters:
e - the event
Returns:
result of condition evaluation

executeActionOf

public void executeActionOf(EventCondition e)
Executes action of a condition event.
Implementation in a subclass can be skipped if the action(s) are empty.

Parameters:
e - the event

getNameOf

public java.lang.String getNameOf(Statechart s)
Returns the name of a statechart.
Must be implemented in a subclass if there are any statecharts.

Parameters:
s - the statechart
Returns:
statechart name

executeActionOf

public void executeActionOf(Statechart s)
Executes startup action of a statechart: calls actions of the statechart entry point, entry action of initial states, starts the corresponding transitions, etc., and sets up the initially active simple state.
Must be implemented in a subclass if there are any statecharts.

Parameters:
s - the statechart

getNameOfState

public java.lang.String getNameOfState(short state)
Returns the name of a statechart state.
Must be implemented in a subclass if there are any states.

Parameters:
state - the state
Returns:
state name

stateContainsState

public boolean stateContainsState(short compstate,
                                  short simpstate)
Checks if one state of a statechart contains another (deep contents - inside contained composite states - are also checked).
Implementation in a subclass can be skipped if there are no composite states.

Parameters:
compstate - the (possibly) composite state
simpstate - the (possibly) simple state
Returns:
true if compstate contains simpstate

getContainerStateOf

public short getContainerStateOf(short state)
Returns the immediate container state of a given state or -1 if the state is at the topmost level (has no container state).
Implementation in a subclass can be skipped if there are no composite states.

Parameters:
state - the state whose immediate container is being looked for
Returns:
the immediate container state of state, or -1

enterState

public void enterState(short state,
                       boolean destination)
Executes entry action of the state and starts the transitions outgoing the state. For simple states also sets up the current simple state of the statechart. For composite states if target is true also executes action of the next level initial state pointer, entry action of the next level initial state, and so on down to the simple state.
Implementation in a subclass can be skipped if the action(s) are empty.

Parameters:
state - the state that is being entered
destination - true if the transition being taken points exactly to this state (for composite states)

exitState

public void exitState(short state,
                      Transition t,
                      boolean source,
                      Statechart statechart)
Cancels all transitions outgoing the state (if source is true, except for t which is being taken and does not need to be canceled) and executes the state exit action. For composite states must call exitInnerStates() beforehand if source is true.

Parameters:
state - the state that is being exited
t - the transition that is being executed and causes the exit
source - true if the transition being taken exits exactly this state (for composite states)
statechart - the statechart whose transition is being taken

exitInnerStates

public final void exitInnerStates(short state,
                                  Statechart statechart)
Calls ExitState() for all states inside state from the currently active simple state up to to state (not including state). Should be called for a composite stete when a transition that exits that state is being taken.
This method should not be implemented in subclasses.

Parameters:
state - the state that is being exited
statechart - the statechart whose transition is being taken

getNameOf

public java.lang.String getNameOf(TransitionTimeout t)
Returns the name of a timeout transition.
Must be implemented in a subclass if there are any timeout transitions.

Parameters:
t - the transition
Returns:
transition name

evaluateTimeoutOf

public double evaluateTimeoutOf(TransitionTimeout t)
Evaluates timeout expression of a timeout transition.
Must be implemented in a subclass if there are any timeout transitions.

Parameters:
t - the transition
Returns:
the timeout value

testGuardOf

public boolean testGuardOf(TransitionTimeout t)
Tests the guard expression of a timeout transition.
Implementation in a subclass can be skipped if the guard(s) are empty.

Parameters:
t - the transition
Returns:
result of guard evaluation

executeActionOf

public void executeActionOf(TransitionTimeout t)
Executes action of a timeout transition.
Implementation in a subclass can be skipped if the action(s) are empty.

Parameters:
t - the transition

getStatechartOf

public Statechart getStatechartOf(TransitionTimeout t)
Returns the statechart where the timeout transition belongs to.
Must be implemented in a subclass if there are any timeout transitions.

Parameters:
t - the transition.
Returns:
the statechart of the transition

getNameOf

public java.lang.String getNameOf(TransitionRate t)
Returns the name of a rate transition.
Must be implemented in a subclass if there are any rate transitions.

Parameters:
t - the transition
Returns:
transition name

evaluateRateOf

public double evaluateRateOf(TransitionRate t)
Evaluates the rate expression of a rate transition.
Must be implemented in a subclass if there are any rate transitions.

Parameters:
t - the transition
Returns:
the rate value

testGuardOf

public boolean testGuardOf(TransitionRate t)
Tests the guard expression of a rate transition.
Implementation in a subclass can be skipped if the guard(s) are empty.

Parameters:
t - the transition
Returns:
result of guard evaluation

executeActionOf

public void executeActionOf(TransitionRate t)
Executes action of a rate transition.
Implementation in a subclass can be skipped if the action(s) are empty.

Parameters:
t - the transition

getStatechartOf

public Statechart getStatechartOf(TransitionRate t)
Returns the statechart where the rate transition belongs to.
Must be implemented in a subclass if there are any rate transitions.

Parameters:
t - the transition.
Returns:
the statechart of the transition

getNameOf

public java.lang.String getNameOf(TransitionCondition t)
Returns the name of a condition transition.
Must be implemented in a subclass if there are any condition transitions.

Parameters:
t - the transition
Returns:
transition name

testConditionOf

public boolean testConditionOf(TransitionCondition t)
Tests the condition expression of a transition event.
Must be implemented in a subclass if there are any condition transitions.

Parameters:
t - the transition
Returns:
result of condition evaluation

testGuardOf

public boolean testGuardOf(TransitionCondition t)
Tests the guard expression of a condition transition.
Implementation in a subclass can be skipped if the guard(s) are empty.

Parameters:
t - the transition
Returns:
result of guard evaluation

executeActionOf

public void executeActionOf(TransitionCondition t)
Executes action of a condition transition.
Implementation in a subclass can be skipped if the action(s) are empty.

Parameters:
t - the transition

getStatechartOf

public Statechart getStatechartOf(TransitionCondition t)
Returns the statechart where the condition transition belongs to.
Must be implemented in a subclass if there are any condition transitions.

Parameters:
t - the transition.
Returns:
the statechart of the transition

getNameOf

public java.lang.String getNameOf(TransitionMessage t)
Returns the name of a message transition.
Must be implemented in a subclass if there are any message transitions.

Parameters:
t - the transition
Returns:
transition name

testMessageOf

public boolean testMessageOf(TransitionMessage t,
                             java.lang.Object msg)
Tests the message received by the statechart against the trigger description of a message transition - for Object message type.
Must be implemented in a subclass if there are any message transitions.

Parameters:
t - the transition.
msg - the message received
Returns:
true if the message matches the trigger, false otherwise

testGuardOf

public boolean testGuardOf(TransitionMessage t)
Tests the guard expression of a message transition.
Implementation in a subclass can be skipped if the guard(s) are empty.

Parameters:
t - the transition
Returns:
result of guard evaluation

executeActionOf

public void executeActionOf(TransitionMessage t,
                            java.lang.Object msg)
Executes action of a message transition for Object message type - depends on the message.
Implementation in a subclass can be skipped if the action(s) are empty.

Parameters:
t - the transition
msg - the message received

executeActionOf

public void executeActionOf(TransitionMessage t,
                            int msg)
Executes action of a message transition for int message type - depends on the message.
Implementation in a subclass can be skipped if the action(s) are empty.

Parameters:
t - the transition
msg - the message received

getStatechartOf

public Statechart getStatechartOf(TransitionMessage t)
Returns the statechart where the message transition belongs to.
Must be implemented in a subclass if there are any message transitions.

Parameters:
t - the transition.
Returns:
the statechart of the transition

getNameOf

public java.lang.String getNameOf(Port<?,?> p)
Returns the name of a port.
Must be implemented in a subclass if there are any ports.

Parameters:
p - the port
Returns:
port name

executeOnSendActionOf

public boolean executeOnSendActionOf(Port<?,?> p,
                                     java.lang.Object msg)
Executes action associated with a message being sent via a port. The code may analyze the message and prevent the port from continuing processing it by returning false.
Implementation in a subclass can be skipped if all actions are empty. Otherwise, for all empty actions true must be returned.

Parameters:
p - the port
msg - the message being sent

executeOnReceiveActionOf

public boolean executeOnReceiveActionOf(Port<?,?> p,
                                        java.lang.Object msg)
Executes action code associated with a message being received at a port. The code may analyze the message and prevent the port from continuing processing it by returning false.
Implementation in a subclass can be skipped if all actions are empty. Otherwise, for all empty actions true must be returned.

Parameters:
p - the port
msg - the message being received

getNameOf

public java.lang.String getNameOf(ActiveObject ao)
Returns the name of a simple (not replicated) embedded object.
Must be implemented in a subclass if there are any embedded objects.

Parameters:
ao - the embedded active object
Returns:
embedded object name

getNameOf

public java.lang.String getNameOf(ActiveObjectCollection<?> aocollection)
Returns the name of a replicated embedded object.
Must be implemented in a subclass if there are any replicated embedded objects.

Parameters:
aocollection - the embedded collection of active objects
Returns:
embedded object list name

getCameras3D

public int getCameras3D(java.util.Map<java.lang.String,Camera3D> output)
Adds all Camera3D of this active object to the given map output, if it is not null.
Default implementation does nothing and returns 0.

Parameters:
output - the map for 3D cameras (field name -> 3D camera), not cleared by this method, may be null: in this case the method only returns the number of 3D cameras.
Returns:
the number of 3D cameras in this active object

drawParameter

@Deprecated
public void drawParameter(Panel panel,
                                     java.awt.Graphics2D g,
                                     int x,
                                     int y,
                                     int xname,
                                     int yname,
                                     java.lang.String name,
                                     java.lang.Object param,
                                     boolean dynamic,
                                     boolean array)
Deprecated. will be removed in next release. Use drawParameter(Panel, Graphics2D, int, int, int, int, String, Object, int)


drawParameter

public void drawParameter(Panel panel,
                          java.awt.Graphics2D g,
                          int x,
                          int y,
                          int xname,
                          int yname,
                          java.lang.String name,
                          java.lang.Object param,
                          int drawingAttributes)
Draws a parameter image and ins name at the given positions and displays the parameter toString text underneath the name. If parameter is null, the image is grayed.

Parameters:
panel - the presentation panel
g - the graphics context
x - x coordinate of the parameter image (center)
y - y coordinate of the parameter image (center)
xname - x coordinate of the parameter name text
yname - y coordinate of the parameter name text
name - the parameter name
param - the parameter itself (or null for dynamic parameter)
drawingAttributes - a combination of DRAW_SD_* constants, not all attributes are applicable for this operation

drawStock

@Deprecated
public void drawStock(Panel panel,
                                 java.awt.Graphics2D g,
                                 int x,
                                 int y,
                                 int xname,
                                 int yname,
                                 java.lang.String name,
                                 java.lang.Object stock,
                                 boolean shadow)
Deprecated. will be removed in next release. Use drawStock(Panel, Graphics2D, int, int, int, int, int, int, String, Object, Color, int)


drawStock

public void drawStock(Panel panel,
                      java.awt.Graphics2D g,
                      int x,
                      int y,
                      int width,
                      int height,
                      int xname,
                      int yname,
                      java.lang.String name,
                      java.lang.Object stock,
                      java.awt.Color color,
                      int drawingAttributes)
Draws a stock image and its name at the given positions and displays the stock value underneath the name. If the stock is empty, the image is not filled, if the stock is negative, the image is filled with red. For hyper arrays empty means all elements are zero, and negative means at least one element is negative.

Parameters:
panel - the presentation panel
g - the graphics context
x - x coordinate of the stock image (center)
y - y coordinate of the stock image (center)
width - the width of the stock image
height - the height of the stock image
xname - x coordinate of the stock name text
yname - y coordinate of the stock name text
name - the stock name
stock - the stock itself
color - the color of the stock image
drawingAttributes - a combination of DRAW_SD_* constants, not all attributes are applicable for this operation

drawFlow

@Deprecated
public void drawFlow(Panel panel,
                                java.awt.Graphics2D g,
                                int x,
                                int y,
                                int xname,
                                int yname,
                                java.lang.String name,
                                java.lang.Object flow,
                                boolean constant,
                                boolean external,
                                boolean shadow)
Deprecated. This method is no more supported and will be removed in next release. Use drawFlow(Panel, Graphics2D, int[], int[], int, int, float, int, int, String, Object, Color, int)


drawFlow

public void drawFlow(Panel panel,
                     java.awt.Graphics2D g,
                     int[] pointsX,
                     int[] pointsY,
                     int valveX,
                     int valveY,
                     float valveAngle,
                     int xname,
                     int yname,
                     java.lang.String name,
                     java.lang.Object flow,
                     java.awt.Color color,
                     int drawingAttributes)
Draws a flow image and its name at the given positions and displays the flow value underneath the name. If the flow is zero, the image is not filled, if the flow is negative, the image is filled with red. For hyper arrays empty means all elements are zero, and negative means at least one element is negative.

Parameters:
panel - the presentation panel
g - the graphics context
pointsX - array of x coordinates of the flow arrow points
pointsY - array of y coordinates of the flow arrow points
valveX - x coordinate of the flow valve image (center)
valveY - y coordinate of the flow valve image (center)
valveAngle - the orientation angle of the flow valve image, in radians
xname - x coordinate of the flow name text
yname - y coordinate of the flow name text
name - the flow name
flow - the flow itself, either HyperArray or double
color - the color of the flow arrow
drawingAttributes - a combination of DRAW_SD_* constants, not all attributes are applicable for this operation

drawAuxiliaryVariable

@Deprecated
public void drawAuxiliaryVariable(Panel panel,
                                             java.awt.Graphics2D g,
                                             int x,
                                             int y,
                                             int xname,
                                             int yname,
                                             java.lang.String name,
                                             java.lang.Object aux,
                                             boolean constant,
                                             boolean external,
                                             boolean shadow)
Deprecated. will be removed in next release. Use drawAuxiliaryVariable(Panel, Graphics2D, int, int, int, int, String, Object, Color, int)


drawAuxiliaryVariable

public void drawAuxiliaryVariable(Panel panel,
                                  java.awt.Graphics2D g,
                                  int x,
                                  int y,
                                  int xname,
                                  int yname,
                                  java.lang.String name,
                                  java.lang.Object aux,
                                  java.awt.Color color,
                                  int drawingAttributes)
Draws an auxiliary variable image and its name at the given positions and displays the variable value underneath the name.

Parameters:
panel - the presentation panel
g - the graphics context
x - x coordinate of the variable image (center)
y - y coordinate of the variable image (center)
xname - x coordinate of the variable name text
yname - y coordinate of the variable name text
name - the variable name
aux - the variable itself, either HyperArray or double
color - the color of the variable image
drawingAttributes - a combination of DRAW_SD_* constants, not all attributes are applicable for this operation

setupPlainDependencyArc

@Deprecated
public static final void setupPlainDependencyArc(java.awt.geom.Arc2D.Double arc,
                                                            double xstart,
                                                            double ystart,
                                                            double xend,
                                                            double yend,
                                                            double height)
Deprecated. this method is deprecated and will be removed in the next release

Sets a given Arc2D object according to the coordinates of the plain dependency start and end points and height.

Parameters:
arc - the arc object
xstart - the x coordinate of the dependency source variable
ystart - the y coordinate of the dependency source variable
xend - the x coordinate of the dependency target variable
yend - the y coordinate of the dependency target variable
height - the arch height (maximum distance of the arc from the chord)

drawPlainDependencyArc

@Deprecated
public static void drawPlainDependencyArc(Panel panel,
                                                     java.awt.Graphics2D g,
                                                     java.awt.geom.Arc2D.Double arc,
                                                     java.awt.Color color)
Deprecated. will be removed in next release. Use drawLink(Panel, Graphics2D, java.awt.geom.Arc2D.Double, Color, int, String, float, int)


drawLink

public static void drawLink(Panel panel,
                            java.awt.Graphics2D g,
                            java.awt.geom.Arc2D.Double arc,
                            java.awt.Color color,
                            int lineWidth,
                            java.lang.String polarity,
                            float polarityPosition,
                            int drawingAttributes)
Draws a link as arc with arrow.

Parameters:
panel - the presentation panel
g - the graphics where the drawing takes place
arc - the pre-set arc object to draw
color - the color of the arc or null for the default color
lineWidth - the width of the link line
polarity - polarity sign, may be null, "+", "-" or any other character
polarityPosition - polarity sign position
drawingAttributes - a combination of DRAW_SD_* constants, not all attributes are applicable for this operation

drawPlainDependencyLine

@Deprecated
public static void drawPlainDependencyLine(Panel panel,
                                                      java.awt.Graphics2D g,
                                                      int xstart,
                                                      int ystart,
                                                      int xend,
                                                      int yend,
                                                      java.awt.Color color)
Deprecated. will be removed in next release. Use drawLink(Panel, Graphics2D, int, int, int, int, Color, int, String, float, int)


drawLink

public static void drawLink(Panel panel,
                            java.awt.Graphics2D g,
                            int xstart,
                            int ystart,
                            int xend,
                            int yend,
                            java.awt.Color color,
                            int lineWidth,
                            java.lang.String polarity,
                            float polarityPosition,
                            int drawingAttributes)
Draws a link as arrowline.

Parameters:
panel - the presentation panel
g - the graphics where the drawing takes place
xstart - the x coordinate of the line start point
ystart - the y coordinate of the line start point
xend - the x coordinate of the line end point
yend - the y coordinate of the line end point
color - the color of the line or null for the default color
lineWidth - the width of the link line
polarity - polarity sign, may be null, "+", "-" or any other character
polarityPosition - polarity sign position
drawingAttributes - a combination of DRAW_SD_* constants, not all attributes are applicable for this operation

drawFlowStockDependencyLine

@Deprecated
public static void drawFlowStockDependencyLine(Panel panel,
                                                          java.awt.Graphics2D g,
                                                          int xstart,
                                                          int ystart,
                                                          int xend,
                                                          int yend,
                                                          java.awt.Color color)
Deprecated. This method is no more supported and will be removed in next release.


drawCausalLoop

public static void drawCausalLoop(Panel panel,
                                  java.awt.Graphics2D g,
                                  int x,
                                  int y,
                                  boolean clockwise,
                                  java.awt.Color color,
                                  java.lang.String type,
                                  java.lang.String text)
Draws a causal loop icon

Parameters:
panel - the presentation panel
g - the graphics where the drawing takes place
x - the x coordinate of the causal loop icon center
y - the y coordinate of the causal loop icon center
clockwise - the direction of the causal loop arrow, true for CW, false for CCW
color - the color of the causal loop icon
type - "B" or "R" typically, but can be any string
text - some text which will be written under loop icon, may be null

drawEvent

public void drawEvent(Panel panel,
                      java.awt.Graphics2D g,
                      int x,
                      int y,
                      int xname,
                      int yname,
                      java.lang.String name,
                      Event e)
Draws an event image and its name at the given positions. If the event is scheduled, it is drawn in blue and the remaining time is displayed underneath the name. If the event is currently being executed, it is drawn in red/yellow. If the event is inactive, it is drawn not filled.

Parameters:
panel - the presentation panel
g - the graphics context
x - x coordinate of the event image (center)
y - y coordinate of the event image (center)
xname - x coordinate of the event name text
yname - y coordinate of the event name text
name - the name of the event, or null
e - the event itself

drawDynamicEvent

public void drawDynamicEvent(Panel panel,
                             java.awt.Graphics2D g,
                             int x,
                             int y,
                             int xname,
                             int yname,
                             java.lang.String name,
                             java.lang.Class<?> c)
Draws a dynamic event image and its (class) name at the given positions. If an instance of such event is currently being executed, it is drawn in red/yellow.

Parameters:
panel - the presentation panel
g - the graphics context
x - x coordinate of the dynamic event image (center)
y - y coordinate of the dynamic event image (center)
xname - x coordinate of the dynamic event name text
yname - y coordinate of the dynamic event name text
name - the name of the event, or null
c - the dynamic event class

drawSchedule

public void drawSchedule(Panel panel,
                         java.awt.Graphics2D g,
                         int x,
                         int y,
                         int xname,
                         int yname,
                         java.lang.String name,
                         Schedule<?> s)
Description copied from class: Presentable
Draws a schedule image and its name at the given positions.

Overrides:
drawSchedule in class Presentable
Parameters:
panel - the presentation panel
g - the graphics context
x - x coordinate of the schedule image (center)
y - y coordinate of the schedule image (center)
xname - x coordinate of the schedule name text
yname - y coordinate of the schedule name text
name - the name of the schedule, or null
s - the schedule itself

drawState

public void drawState(Panel panel,
                      java.awt.Graphics2D g,
                      int x,
                      int y,
                      int width,
                      int height,
                      int xname,
                      int yname,
                      java.lang.String name,
                      java.awt.Color color,
                      short state,
                      Statechart statechart)
Draws a statechart state and its name at the given position. If the state is active (current) its border is drawn thick and red.

Parameters:
panel - the presentation panel
g - the graphics context
x - x coordinate of the state upper left corner
y - y coordinate of the state upper left corner
width - width of the state rectangle
height - height of the state rectangle
xname - x coordinate of the state name text
yname - y coordinate of the state name text
name - the name of the state, or null
color - fill color of the state as defined by the user
state - the state itself
statechart - the statechart where the state belongs to

drawHistoryState

public void drawHistoryState(Panel panel,
                             java.awt.Graphics2D g,
                             int x,
                             int y,
                             int xname,
                             int yname,
                             java.lang.String name,
                             short state,
                             boolean deep)
Draws a statechart history pseudostate and its name at the given position.

Parameters:
panel - the presentation panel
g - the graphics context
x - x coordinate of the state center
y - y coordinate of the state center
xname - x coordinate of the state name text
yname - y coordinate of the state name text
name - the name of the state, or null
state - the state id
deep - if true, this is deep history state, otherwise shallow

drawBranchState

public void drawBranchState(Panel panel,
                            java.awt.Graphics2D g,
                            int x,
                            int y,
                            int xname,
                            int yname,
                            java.lang.String name,
                            short state)
Draws a statechart branch pseudostate and its name at the given position.

Parameters:
panel - the presentation panel
g - the graphics context
x - x coordinate of the state center
y - y coordinate of the state center
xname - x coordinate of the state name text
yname - y coordinate of the state name text
name - the name of the state, or null
state - the state id

drawFinalState

public void drawFinalState(Panel panel,
                           java.awt.Graphics2D g,
                           int x,
                           int y,
                           int xname,
                           int yname,
                           java.lang.String name,
                           short state,
                           Statechart statechart)
Draws a statechart branch state and its name at the given position.

Parameters:
panel - the presentation panel
g - the graphics context
x - x coordinate of the state center
y - y coordinate of the state center
xname - x coordinate of the state name text
yname - y coordinate of the state name text
name - the name of the state, or null
state - the state id
statechart - the statechart where the state belongs to

drawTransition

public void drawTransition(Panel panel,
                           java.awt.Graphics2D g,
                           int[] x,
                           int[] y,
                           int xname,
                           int yname,
                           java.lang.String name,
                           Transition tr)
Draws a statechart transition and its name at the given position. If the transition is scheduled, it is drawn thicker and blue and the remaining time is displayed underneath the name. If the transition is currently being executed, it is drawn in red.

Parameters:
panel - the presentation panel
g - the graphics context
x - array of x coordinates of the transition base points
y - array of y coordinates of the transition base points
xname - x coordinate of the transition name text
yname - y coordinate of the transition name text
name - the name of the transition, or null
tr - the transition itself

drawBranchExit

public void drawBranchExit(Panel panel,
                           java.awt.Graphics2D g,
                           int[] x,
                           int[] y,
                           int xname,
                           int yname,
                           java.lang.String name)
Draws a statechart branch exit (pseudotransition) and its name at the given position.

Parameters:
panel - the presentation panel
g - the graphics context
x - array of x coordinates of the pseudotransition base points
y - array of y coordinates of the pseudotransition base points
xname - x coordinate of the pseudotransition name text
yname - y coordinate of the pseudotransition name text
name - name of the branch exit

drawStatechartEntryPoint

public void drawStatechartEntryPoint(Panel panel,
                                     java.awt.Graphics2D g,
                                     int xstart,
                                     int ystart,
                                     int xend,
                                     int yend,
                                     int xname,
                                     int yname,
                                     java.lang.String name,
                                     Statechart statechart)
Draws a statechart entry point and the statechart name at the given position.

Parameters:
panel - the presentation panel
g - the graphics context
xstart - the x coordinate of the line start point
ystart - the y coordinate of the line start point
xend - the x coordinate of the line end point
yend - the y coordinate of the line end point
xname - x coordinate of the statechart name text
yname - y coordinate of the statechart name text
name - the name of the statechart, or null
statechart - the statechart itself

drawInitialStatePointer

public void drawInitialStatePointer(Panel panel,
                                    java.awt.Graphics2D g,
                                    int xstart,
                                    int ystart,
                                    int xend,
                                    int yend)
Draws an initial state pointer at the given position.

Parameters:
panel - the presentation panel
g - the graphics context
xstart - the x coordinate of the line start point
ystart - the y coordinate of the line start point
xend - the x coordinate of the line end point
yend - the y coordinate of the line end point

drawActionChart

public void drawActionChart(Panel panel,
                            java.awt.Graphics2D g,
                            int x,
                            int y,
                            int width,
                            int height,
                            int xname,
                            int yname,
                            java.lang.String name,
                            java.awt.Color fillColor)
Draws an action chart image and its name at the given positions.

Parameters:
panel - the presentation panel
g - the graphics where the drawing takes place
x - the x coordinate of the action chart shape
y - the y coordinate of the action chart shape
width - the width of the action chart shape
height - the height of the action chart shape
xname - the x coordinate of the action chart name
yname - the y coordinate of the action chart name
name - the action chart name
fillColor - the fill color of the action chart shape

drawCodeBlock

public void drawCodeBlock(Panel panel,
                          java.awt.Graphics2D g,
                          int x,
                          int y,
                          int width,
                          int height,
                          java.lang.String text,
                          boolean comment,
                          java.awt.Color fillColor)
Draws an action chart Code block image at the given positions.

Parameters:
panel - the presentation panel
g - the graphics where the drawing takes place
x - the x coordinate of the action chart Code block shape
y - the y coordinate of the action chart Code block shape
width - the width of the action chart Code block shape
height - the height of the action chart Code block shape
text - the text to be drawn inside the block
comment - whether the text is a comment or code
fillColor - the fill color of the action Code block element shape

drawLocalVariable

public void drawLocalVariable(Panel panel,
                              java.awt.Graphics2D g,
                              int x,
                              int y,
                              int width,
                              int height,
                              java.lang.String text,
                              boolean comment,
                              java.awt.Color fillColor)
Draws an action chart Local Variable block image at the given positions.

Parameters:
panel - the presentation panel
g - the graphics where the drawing takes place
x - the x coordinate of the action chart Local Variable block shape
y - the y coordinate of the action chart Local Variable block shape
width - the width of the action chart Local Variable block shape
height - the height of the action chart Local Variable block shape
text - the text to be drawn inside the block
comment - whether the text is a comment or code
fillColor - the fill color of the action chart Local Variable block shape

drawLoopBlock

public void drawLoopBlock(Panel panel,
                          java.awt.Graphics2D g,
                          int x,
                          int y,
                          int width,
                          int height,
                          java.lang.String text,
                          boolean comment,
                          java.awt.Color fillColor)
Draws an action chart Loop block image at the given positions.

Parameters:
panel - the presentation panel
g - the graphics where the drawing takes place
x - the x coordinate of the action chart Loop block shape
y - the y coordinate of the action chart Loop block shape
width - the width of the action chart Loop block shape
height - the height of the action chart Loop block shape
text - the text to be drawn inside the block
comment - whether the text is a comment or code
fillColor - the fill color of the action chart Loop block shape

drawLoopArea

public void drawLoopArea(Panel panel,
                         java.awt.Graphics2D g,
                         int x,
                         int y,
                         int width,
                         int height)
Draws the action chart loop area shape at the given positions.

Parameters:
panel - the presentation panel
g - the graphics where the drawing takes place
x - the x coordinate of the action chart loop area shape
y - the y coordinate of the action chart loop area shape
width - the width of the action chart loop area shape
height - the height of the action chart loop area shape

drawDecisionBlock

public void drawDecisionBlock(Panel panel,
                              java.awt.Graphics2D g,
                              int x,
                              int y,
                              int width,
                              int height,
                              java.lang.String text,
                              boolean comment,
                              java.awt.Color fillColor,
                              boolean isTruePoint,
                              int trueX,
                              int trueY,
                              boolean isFalsePoint,
                              int falseX,
                              int falseY,
                              int areaHeight,
                              int appearance)
Draws an action chart Decision block image at the given positions.

Parameters:
panel - the presentation panel
g - the graphics where the drawing takes place
x - the x coordinate of the action chart Decision block shape
y - the y coordinate of the action chart Decision block shape
width - the width of the action chart Decision block shape
height - the height of the action chart Decision block shape
text - the text to be drawn inside the block
comment - whether the text is a comment or code
fillColor - the fill color of the action chart Decision block shape
isTruePoint - whether this decision has true branch not interrupted with Return block
trueX - the x coordinate of the starting point of final true branch
trueY - the y coordinate of the starting point of final true branch
isFalsePoint - whether this decision has false branch not interrupted with Return block
falseX - the x coordinate of the starting point of final false branch
falseY - the y coordinate of the starting point of final false branch
areaHeight - the height of the area under the Decision block
appearance - custom flags defining how the branches are being drawn

drawReturnBlock

public void drawReturnBlock(Panel panel,
                            java.awt.Graphics2D g,
                            int x,
                            int y,
                            int width,
                            int height,
                            java.lang.String text,
                            boolean comment,
                            java.awt.Color fillColor)
Draws an action chart Return block image at the given positions.

Parameters:
panel - the presentation panel
g - the graphics where the drawing takes place
x - the x coordinate of the action chart Return block shape
y - the y coordinate of the action chart Return block shape
width - the width of the action chart Return block shape
height - the height of the action chart Return block shape
text - the text to be drawn inside the block
comment - whether the text is a comment or code
fillColor - the fill color of the action chart Return block shape

drawBreakBlock

public static void drawBreakBlock(Panel panel,
                                  java.awt.Graphics2D g,
                                  int x,
                                  int y,
                                  int width,
                                  int height,
                                  boolean continueOrBreak,
                                  java.awt.Color fillColor)
Draws the action chart Brake/Continue Loop block shape.

Parameters:
panel - the presentation panel
g - the graphics where the drawing takes place
x - the x coordinate of the action chart Return block shape
y - the y coordinate of the action chart Return block shape
width - the width of the action chart Return block shape
height - the height of the action chart Return block shape
continueOrBreak - block type (true = continue; false = break)
fillColor - the fill color of the action chart shape

drawActionChartLink

public void drawActionChartLink(Panel panel,
                                java.awt.Graphics2D g,
                                int x,
                                int yStart,
                                int yEnd)
Draws an action chart link at the given positions.

Parameters:
panel - the presentation panel
g - the graphics where the drawing takes place
x - the x coordinate of the action chart link shape
yStart - the y coordinate of the action chart link shape start
yEnd - the y coordinate of the action chart link shape end

drawPort

public void drawPort(Panel panel,
                     java.awt.Graphics2D g,
                     int x,
                     int y,
                     int xname,
                     int yname,
                     java.lang.String name,
                     Port<?,?> port)
Draws a port at the given position.

Parameters:
panel - the presentation panel
g - the graphics context
x - the x coordinate of the port
y - the y coordinate of the port
xname - the x coordinate of the port name
yname - the y coordinate of the port name
name - the name of the port, or null
port - the port

drawConnector

public void drawConnector(Panel panel,
                          java.awt.Graphics2D g,
                          int[] x,
                          int[] y,
                          boolean variablesConnector)
Draws a port or variable connector

Parameters:
panel - the presentation panel
g - the graphics context
x - array of x coordinates of the connector base points
y - array of y coordinates of the connector base points
variablesConnector - either this connector is connector between variables or not

drawEnvironment

public void drawEnvironment(Panel panel,
                            java.awt.Graphics2D g,
                            int x,
                            int y,
                            int xname,
                            int yname,
                            java.lang.String name,
                            Environment<?> env)

drawEmbeddedObjectModel

public void drawEmbeddedObjectModel(Panel panel,
                                    java.awt.Graphics2D g,
                                    int x,
                                    int y,
                                    int xname,
                                    int yname,
                                    java.lang.String name,
                                    ActiveObject embeddedObject)
Draws a non-replicated embedded object icon part at the given position.

Parameters:
panel - the presentation panel
g - the graphics context
x - the x coordinate of the embedded object
y - the y coordinate of the embedded object
xname - the x coordinate of the embedded object name
yname - the y coordinate of the embedded object name
name - the name of the embedded object, or null
embeddedObject - the embedded object

drawEmbeddedObjectModel

public void drawEmbeddedObjectModel(Panel panel,
                                    java.awt.Graphics2D g,
                                    int x,
                                    int y,
                                    int xname,
                                    int yname,
                                    java.lang.String name,
                                    ActiveObjectCollection<?> embeddedObjectList)
Draws a replicated embedded object icon part at the given position. Actually, draws the icon part of the first instance only, if any.

Parameters:
panel - the presentation panel
g - the graphics context
x - the x coordinate of the embedded object
y - the y coordinate of the embedded object
xname - the x coordinate of the embedded object name
yname - the y coordinate of the embedded object name
name - the name of the embedded object, or null
embeddedObjectList - the replicated embedded object

drawEmbeddedObjectModelDefault

public void drawEmbeddedObjectModelDefault(Panel panel,
                                           java.awt.Graphics2D g,
                                           int x,
                                           int y,
                                           int xname,
                                           int yname,
                                           java.lang.String name,
                                           ActiveObject embeddedObject)
Draws a non-replicated object default icon at the given position.

Parameters:
panel - the presentation panel
g - the graphics context
x - the x coordinate of the embedded object
y - the y coordinate of the embedded object
xname - the x coordinate of the embedded object name
yname - the y coordinate of the embedded object name
name - the name of the embedded object, or null
embeddedObject - the embedded object

drawEmbeddedObjectModelDefault

public void drawEmbeddedObjectModelDefault(Panel panel,
                                           java.awt.Graphics2D g,
                                           int x,
                                           int y,
                                           int xname,
                                           int yname,
                                           java.lang.String name,
                                           ActiveObjectCollection<?> embeddedObjectList)
Draws a replicated embedded object default icon at the given position.

Parameters:
panel - the presentation panel
g - the graphics context
x - the x coordinate of the embedded object
y - the y coordinate of the embedded object
xname - the x coordinate of the embedded object name
yname - the y coordinate of the embedded object name
name - the name of the embedded object, or null
embeddedObjectList - the replicated embedded object

setParametersToDefaultValues

public void setParametersToDefaultValues()
Sets all not dynamic parameters to their default values.
This method must be implemented in a subclass, during code generation.
This method is designed to be used in custom experiments for easier setup of root active object in certain situations.


create

public void create()
Creates the active object embedded objects; also calls user's onCreate() at the end. Is called after the the active object has been constructed and its parameters have been setup by the owner object.
If there are any embedded objects, or the user has onCreate code, this method must be implemented in a subclass, otherwise it is not needed.


start

public void start()
Starts activities (e.g. schedules initial events) in this active object: events, statecharts and embedded objects, submits equations. Should be implemented in subclasses, by default does nothing.


stopSimulation

public boolean stopSimulation()
Engine command applicable only in any non-IDLE state (in IDLE state does nothing and returns false). If the state is RUNNING, sets a flag that, when tested by the model execution thread, causes it to terminate. Further behavior depends on context where this method is called:

See Also:
Engine.stop()

finishSimulation

public boolean finishSimulation()
Engine command applicable only in RUNNING or PAUSED state (in other states does nothing and returns false). Sets a flag that, when tested by the engine, causes it to finish after completing the current event execution. Further behavior depends on context where this method is called: Note that by the time this method finishes, the engine may be in FINISHED, or ERROR state.

Returns:
false if the engine state does not allow pausing
See Also:
Engine.finish()

pauseSimulation

public boolean pauseSimulation()
Engine command applicable only in RUNNING state (in other states does nothing and returns false). Puts the engine into PLEASE_WAIT state and then sets a flag that, when tested by the engine, causes it to pause after completing the current event execution. Further behavior depends on context where this method is called: Note that by the time this method finishes, the engine may be in PAUSED, FINISHED, or ERROR state.

Returns:
false if the engine state does not allow pausing
See Also:
Engine.pause()

runSimulation

public boolean runSimulation()
Engine command applicable only in PAUSED state (in other states does nothing and returns false). Puts the engine into RUNNING state and then starts the model execution in a separate thread. The execution may discontinue due to the one of the following reasons
- there are no more events to execute (state -> FINISHED)
- stopTime is reached (state -> FINISHED)
- pause() was called (state -> PAUSED)
- root active object has been destroyed (state -> FINISHED)
- exception occurred during event execution or active object destruction (state -> ERROR)
This method should never be called from the model execution thread!
Please note that by the time this method finishes, then engine may already be in PAUSED, FINISHED, or ERROR state.

Returns:
false if the engine state does not allow running
See Also:
Engine.run()

setDestroyed

public void setDestroyed()
Marks this object as subject to destruction after the current step is finished. Only this method should be called during a step, and not onDestroy()!


onDestroy

public void onDestroy()
Must be called when the active object is dynamically disposed. Deletes all event entries belonging to the active object from the engine and unsubmits equations.
Don't call this method during step, use setDestroyed() instead


getIntegrationManager_xjal

public ActiveObjectIntegrationManager getIntegrationManager_xjal()
This method shouldn't be normally called by user.
Returns static integration manager defined in derived classes.

Returns:
static integration manager defined in derived classes

getScalarPhaseVector_xjal

public void getScalarPhaseVector_xjal(double[] D,
                                      double[] A)
This method shouldn't be normally called by user.
Assigns given arrays with current variables values

Parameters:
D -
A -

putScalarPhaseVector_xjal

public void putScalarPhaseVector_xjal(double[] D,
                                      double[] A)
This method shouldn't be normally called by user.
Assigns variables values from the given arrays

Parameters:
D -
A -

formulasExecute_xjal

public void formulasExecute_xjal()
This method shouldn't be normally called by user.
Executes formulas defined in this active object.


getScalarPhaseVectorForInitialConditions_xjal

public void getScalarPhaseVectorForInitialConditions_xjal(double[] D,
                                                          double[] A)
This method shouldn't be normally called by user.
Assigns given arrays with current variables values (the function is used while solving initial conditions loops)

Parameters:
D -
A -

putScalarPhaseVectorForInitialConditions_xjal

public void putScalarPhaseVectorForInitialConditions_xjal(double[] D,
                                                          double[] A)
This method shouldn't be normally called by user.
Assigns variables values from the given arrays (the function is is used while solving initial conditions loops)

Parameters:
D -
A -

getScalarRightPartForInitialConditions_xjal

public void getScalarRightPartForInitialConditions_xjal(double[] DR,
                                                        double[] AR)
This method shouldn't be normally called by user.
Returns right part while solving algebraic loops in initial conditions


getScalarRightPart_xjal

public void getScalarRightPart_xjal(double[] DR,
                                    double[] AR)
This method shouldn't be normally called by user.
Calculates right parts of differential equations and algebraic equations to the given arrays

Parameters:
DR -
AR -

assignInitialConditions_xjal

public void assignInitialConditions_xjal()
This method shouldn't be normally called by user.
This function assigns initial conditions for stocks and for flow aux variables


restoreOwner

public void restoreOwner(java.lang.Object owner)
This method normally should not be called by user
This method restores owner of this object
The method is used in snapshot saving/loading

Specified by:
restoreOwner in interface com.xj.anylogic.engine.internal.Child
Parameters:
owner - owner of this object, usually ActiveObject, Experiment or ShapeGroup


Copyright © 1991-2008 XJ Technlogies. All Rights Reserved.