Class SingleTargetEvent

  • All Implemented Interfaces:
    java.lang.Comparable<Event>

    public class SingleTargetEvent
    extends 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

    • Constructor Detail

      • SingleTargetEvent

        public SingleTargetEvent​(java.lang.Object object,
                                 java.lang.String method)
                          throws SimulationException
        Create new event using late binding.
        Throws:
        SimulationException
      • SingleTargetEvent

        public SingleTargetEvent​(java.lang.Object object,
                                 java.lang.Enum<?> actionType)
        Create new event using early binding.
    • Method Detail

      • setForObject

        public void setForObject​(java.lang.Object o,
                                 java.lang.String method)
                          throws SimulationException
        Recycling method. See SimEvent for more details.
        Throws:
        SimulationException
      • setForObject

        public void setForObject​(java.lang.Object o,
                                 java.lang.Enum<?> actionType)
        Recycling method. See SimEvent for more details.
      • toString

        public java.lang.String toString()
        Return a string describing event.
        Overrides:
        toString in class java.lang.Object
      • fireEvent

        public void fireEvent()
        Fire event calling the target object.
        Specified by:
        fireEvent in class Event