jas.events
Class RealTimeEventList

java.lang.Object
  extended by java.lang.Thread
      extended by jas.events.EventList
          extended by jas.events.RealTimeEventList
All Implemented Interfaces:
java.lang.Runnable

public class RealTimeEventList
extends EventList

It extends the simple event list. Each scheduled event is fired when the scheduling time corresponds with the system time. If you schedule an event today at 14:00 o'clock the event will be fired only when system clock will be over the 14:00. This event list is used when simulation engine does work in real time mode (as an emulator).
For instance: If today is 1 july 2002 and you want to schedule an event at 4 july 2002 12:00.0 the scheduling instruction is the following:
eventList.scheduleSimple(SimTime.realTime(2002, 7, 4, 12, 0), ...);

Title: JAS

Description: Java Agent-based Simulation library

Copyright (C) 2002 Michele Sonnessa

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.

Author:
Michele Sonnessa


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 long startTime
           
 
Fields inherited from class jas.events.EventList
EVENT_LIST_STEP
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
RealTimeEventList(EventList previousEventList)
          Constructor.
 
Method Summary
 void step()
          Make one simulation step synchronizing system clock with next event.
 
Methods inherited from class jas.events.EventList
addEventListener, addMultiCastService, clear, clearEventListeners, getEventArray, getEventTimeTreshold, getMultiCastService, getRunningStatus, getSimulationTimeout, getTime, removeEventListener, run, schedule, schedule, schedule, scheduleCollection, scheduleCollection, scheduleCollection, scheduleCollection, scheduleGroup, scheduleGroup, scheduleMultiCast, scheduleMultiCast, scheduleSimple, scheduleSimple, scheduleSimple, scheduleSimple, scheduleSystem, scheduleSystem, setEventTimeTreshold, setRunningStatus, setSimulationTimeout, simulate, unschedule
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

startTime

public long startTime
Constructor Detail

RealTimeEventList

public RealTimeEventList(EventList previousEventList)
Constructor. The simulation time unit is set to Millisecond because it is the system time unit.

Parameters:
previousEventList - The eventList that will be substituted. Maybe null.
Method Detail

step

public void step()
Make one simulation step synchronizing system clock with next event.

Overrides:
step in class EventList