Package microsim.event
Class SystemEvent
- java.lang.Object
-
- microsim.event.Event
-
- microsim.event.SystemEvent
-
- All Implemented Interfaces:
java.lang.Comparable<Event>
public class SystemEvent extends Event
System events are directly processed by the simulation engine. There are some special events that engine is able to understand. For instance, you can schedule the end of simulation using a system event.
SystemEvent e = new SystemEvent(Sim.EVENT_SIMULATION_END);
eventQueue.schedule(100, e); The above code make the engine stop at 100. When this event happens the simulationEnd() method of the current running models is called.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
-
-
Constructor Summary
Constructors Constructor Description SystemEvent(SimulationEngine engine, SystemEventType type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fireEvent()
java.lang.String
toString()
Return a string describing event.-
Methods inherited from class microsim.event.Event
compareTo, getLoop, getOrdering, getTime, setTimeAtNextLoop, setTimeOrderingAndLoopPeriod
-
-
-
-
Constructor Detail
-
SystemEvent
public SystemEvent(SimulationEngine engine, SystemEventType type)
-
-
Method Detail
-
fireEvent
public void fireEvent() throws SimulationException
- Specified by:
fireEvent
in classEvent
- Throws:
SimulationException
-
toString
public java.lang.String toString()
Return a string describing event.- Overrides:
toString
in classjava.lang.Object
-
-