org.gscg.common
Class GameAnimator

java.lang.Object
  extended bynl.tudelft.simulation.event.EventProducer
      extended bynl.tudelft.simulation.dsol.simulators.Simulator
          extended bynl.tudelft.simulation.dsol.simulators.DEVSSimulator
              extended bynl.tudelft.simulation.dsol.simulators.DEVDESSSimulator
                  extended byorg.gscg.common.GameAnimator
All Implemented Interfaces:
nl.tudelft.simulation.dsol.simulators.AnimatorInterface, nl.tudelft.simulation.dsol.simulators.DESSSimulatorInterface, nl.tudelft.simulation.dsol.simulators.DEVDESSSimulatorInterface, nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface, nl.tudelft.simulation.event.EventProducerInterface, java.rmi.Remote, java.lang.Runnable, java.io.Serializable, nl.tudelft.simulation.dsol.simulators.SimulatorInterface

public class GameAnimator
extends nl.tudelft.simulation.dsol.simulators.DEVDESSSimulator
implements nl.tudelft.simulation.dsol.simulators.AnimatorInterface

A GameAnimator is used to synchronize between executing the events of the event list of the simulator underneath and the ThreadedEventProducers that are used for communication with remote clients. The event list of a ThreadedEventProducer must be empty before the animator may advance in time.

(c) copyright 2005 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information www.simulation.tudelft.nl . The source code and binary code of this software are proprietary information of Delft University of Technology.

Since:
1.1.3
Version:
$Revision: 1.1 $ $Date: 2005/06/16 12:33:54 $
Author:
Stijn-Pieter van Houten , Alexander Verbraeck
See Also:
Serialized Form

Field Summary
protected  long animationDelay
          AnimationDelay refers to the delay in miliseconds between timeSteps
 java.lang.Object gameSemaphore
          the semaphore for the game
 
Fields inherited from class nl.tudelft.simulation.dsol.simulators.DEVDESSSimulator
timeStep
 
Fields inherited from class nl.tudelft.simulation.dsol.simulators.DEVSSimulator
eventList
 
Fields inherited from class nl.tudelft.simulation.dsol.simulators.Simulator
replication, running, semaphore, simulatorTime, worker
 
Fields inherited from class nl.tudelft.simulation.event.EventProducer
listeners
 
Fields inherited from interface nl.tudelft.simulation.dsol.simulators.AnimatorInterface
ANIMATION_DELAY_CHANGED_EVENT, DEFAULT_ANIMATION_DELAY, UPDATE_ANIMATION_EVENT
 
Fields inherited from interface nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface
EVENTLIST_CHANGED_EVENT
 
Fields inherited from interface nl.tudelft.simulation.dsol.simulators.SimulatorInterface
END_OF_REPLICATION_EVENT, START_EVENT, START_REPLICATION_EVENT, STEP_EVENT, STOP_EVENT, TIME_CHANGED_EVENT, WARMUP_EVENT
 
Fields inherited from interface nl.tudelft.simulation.event.EventProducerInterface
FIRST_POSITION, LAST_POSITION
 
Fields inherited from interface nl.tudelft.simulation.dsol.simulators.DESSSimulatorInterface
DEFAULT_TIME_STEP, TIME_STEP_CHANGED_EVENT
 
Constructor Summary
GameAnimator()
          constructs a new GameAnimator
 
Method Summary
 long getAnimationDelay()
           
 void run()
           
 void setAnimationDelay(long animationDelay)
           
 
Methods inherited from class nl.tudelft.simulation.dsol.simulators.DEVDESSSimulator
getTimeStep, setTimeStep
 
Methods inherited from class nl.tudelft.simulation.dsol.simulators.DEVSSimulator
cancelEvent, getEventList, initialize, scheduleEvent, scheduleEvent, scheduleEvent, scheduleEvent, scheduleEvent, setEventList, step, stop
 
Methods inherited from class nl.tudelft.simulation.dsol.simulators.Simulator
getReplication, getSimulatorTime, isRunning, start
 
Methods inherited from class nl.tudelft.simulation.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, getEventTypes, removeAllListeners, removeAllListeners, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface
cancelEvent, getEventList, scheduleEvent, scheduleEvent, scheduleEvent, scheduleEvent, scheduleEvent, setEventList
 
Methods inherited from interface nl.tudelft.simulation.dsol.simulators.SimulatorInterface
getReplication, getSimulatorTime, initialize, isRunning, start, step, stop
 
Methods inherited from interface nl.tudelft.simulation.event.EventProducerInterface
addListener, addListener, addListener, addListener, getEventTypes, removeListener
 
Methods inherited from interface nl.tudelft.simulation.dsol.simulators.DESSSimulatorInterface
getTimeStep, setTimeStep
 

Field Detail

gameSemaphore

public transient java.lang.Object gameSemaphore
the semaphore for the game


animationDelay

protected long animationDelay
AnimationDelay refers to the delay in miliseconds between timeSteps

Constructor Detail

GameAnimator

public GameAnimator()
constructs a new GameAnimator

Method Detail

getAnimationDelay

public long getAnimationDelay()
Specified by:
getAnimationDelay in interface nl.tudelft.simulation.dsol.simulators.AnimatorInterface
See Also:
#getAnimationDelay()

setAnimationDelay

public void setAnimationDelay(long animationDelay)
Specified by:
setAnimationDelay in interface nl.tudelft.simulation.dsol.simulators.AnimatorInterface
See Also:
#setAnimationDelay(long)

run

public void run()
Specified by:
run in interface java.lang.Runnable
See Also:
DEVSSimulator.run()


Copyright © 2002-2005 Delft University of Technology, the Netherlands. All Rights Reserved.