|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container java.awt.Window java.awt.Frame jsim.process.Model
public class Model
The Model class allows application specific simulation models to be derived from it. It generalizes all models. Simulation models run in their own frame and multiple frames (models) can be active simultaneously.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.Frame |
---|
java.awt.Frame.AccessibleAWTFrame |
Nested classes/interfaces inherited from class java.awt.Window |
---|
java.awt.Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected double |
stopTime
Maximum time until sources are shut down (for safety). |
Fields inherited from class java.awt.Frame |
---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
Model(java.lang.String mName,
double slowness)
Construct a JSIM simulation model to run in an embedded frame. |
|
Model(java.lang.String mName,
Prop[] pList,
Transport[] tList,
AnimationQueue sharedQueue)
Construct a JSIM simulation model to run in an embedded frame. |
Method Summary | |
---|---|
void |
adjustmentValueChanged(java.awt.event.AdjustmentEvent evt)
Handle event by adjusting the view of the design canvas based on position of scrollbars. |
void |
beginSim()
Set the flag to start the simulation. |
java.util.Vector |
collectStatData()
Collect data from all the nodes (except Source FIX) in model. |
void |
endSim()
Set the flag to end the simulation. |
java.util.HashMap<java.lang.Integer,Coroutine> |
getJoinEntity()
Return hash map contains entities waiting on AND join |
java.util.HashMap<java.lang.Integer,Coroutine> |
getLostJoinEntity()
Return hash map containing entities that are lost |
java.lang.String |
getPrimaryStat()
Get the primary statistic for the stopping rule. |
void |
initModel(DynamicNode[] dynNode)
Finish initializing the mode. |
void |
injectAnEntity()
Method to inject an entity in every source node of the model. |
boolean |
isDone()
Is the simulation over? |
FinalReport |
prepareReport()
Prepare a report to ModelAgent. |
void |
run()
Run the display thread. |
void |
setBatchProperties(int bSize,
int nBatch)
Set the batch size and number of batches for all batch statistics. |
void |
setPrimaryStat()
Set the primary statistic to analyze for the stopping rule. |
void |
setPrimaryStat(java.lang.String statNodeName)
Set the primary statistic to analyze for the stopping rule. |
void |
showStats()
Display statistical results as a table in a window. |
void |
start()
Start the display thread. |
void |
triggerModelReportEvent(StatException ex)
Trigger a model report event (call mBean's fire). |
void |
windowActivated(java.awt.event.WindowEvent evt)
|
void |
windowClosed(java.awt.event.WindowEvent evt)
The rest of the WindowEvent handlers are not implemented. |
void |
windowClosing(java.awt.event.WindowEvent evt)
Handle window closing event by exiting/disposing of window. |
void |
windowDeactivated(java.awt.event.WindowEvent evt)
|
void |
windowDeiconified(java.awt.event.WindowEvent evt)
|
void |
windowIconified(java.awt.event.WindowEvent evt)
|
void |
windowOpened(java.awt.event.WindowEvent evt)
|
Methods inherited from class java.awt.Frame |
---|
addNotify, getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, paramString, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
Methods inherited from class java.awt.Window |
---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, toFront |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
---|
getFont, postEvent |
Field Detail |
---|
protected double stopTime
Constructor Detail |
---|
public Model(java.lang.String mName, Prop[] pList, Transport[] tList, AnimationQueue sharedQueue)
mlName
- name of the simulation modelmBean
- bean holding the modelpublic Model(java.lang.String mName, double slowness)
mName
- name of the simulation modelmBean
- bean holding the modelslowness
- factor to slow down animationMethod Detail |
---|
public void initModel(DynamicNode[] dynNode)
dynNodes
- nodes to display on canvaspublic java.lang.String getPrimaryStat()
public void setPrimaryStat(java.lang.String statNodeName)
statNodeName
- the primary statisticpublic void setPrimaryStat()
statNodeName
- the primary statisticpublic void setBatchProperties(int bSize, int nBatch)
bSize
- batch sizenNatch
- number of batchespublic void start()
public void beginSim()
public void endSim()
public boolean isDone()
public void run()
run
in interface java.lang.Runnable
public void showStats()
public FinalReport prepareReport()
FinalReport
- The final report to be sent to the model agentpublic java.util.Vector collectStatData()
public void adjustmentValueChanged(java.awt.event.AdjustmentEvent evt)
adjustmentValueChanged
in interface java.awt.event.AdjustmentListener
evt
- scrollbar adjustment eventpublic void windowClosing(java.awt.event.WindowEvent evt)
windowClosing
in interface java.awt.event.WindowListener
evt
- window closing eventpublic void windowClosed(java.awt.event.WindowEvent evt)
windowClosed
in interface java.awt.event.WindowListener
public void windowDeiconified(java.awt.event.WindowEvent evt)
windowDeiconified
in interface java.awt.event.WindowListener
public void windowIconified(java.awt.event.WindowEvent evt)
windowIconified
in interface java.awt.event.WindowListener
public void windowActivated(java.awt.event.WindowEvent evt)
windowActivated
in interface java.awt.event.WindowListener
public void windowDeactivated(java.awt.event.WindowEvent evt)
windowDeactivated
in interface java.awt.event.WindowListener
public void windowOpened(java.awt.event.WindowEvent evt)
windowOpened
in interface java.awt.event.WindowListener
public void triggerModelReportEvent(StatException ex)
public void injectAnEntity()
public java.util.HashMap<java.lang.Integer,Coroutine> getJoinEntity()
public java.util.HashMap<java.lang.Integer,Coroutine> getLostJoinEntity()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |