Package microsim.event
Class SingleTargetEvent
java.lang.Object
microsim.event.Event
microsim.event.SingleTargetEvent
- All Implemented Interfaces:
Comparable<Event>
The simpler implementation of SimEvent class. It represents an event to be
notified only to one specific object. It is often used in discrete event
simulations, when an object schedule itself for a future event.
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
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSingleTargetEvent(Object object, Enum<?> actionType) Create new event using early binding.SingleTargetEvent(Object object, String method) Create new event using late binding. -
Method Summary
Modifier and TypeMethodDescriptionvoidFire event calling the target object.voidsetForObject(Object o, Enum<?> actionType) Recycling method.voidsetForObject(Object o, String method) Recycling method.toString()Return a string describing event.Methods inherited from class microsim.event.Event
compareTo, getLoop, getOrdering, getTime, setTimeAtNextLoop, setTimeOrderingAndLoopPeriod
-
Field Details
-
eventType
-
methodInvoker
-
object
-
-
Constructor Details
-
SingleTargetEvent
Create new event using late binding.- Throws:
SimulationException
-
SingleTargetEvent
Create new event using early binding.
-
-
Method Details
-
setForObject
Recycling method. See SimEvent for more details.- Throws:
SimulationException
-
setForObject
Recycling method. See SimEvent for more details. -
toString
Return a string describing event. -
fireEvent
public void fireEvent()Fire event calling the target object.
-