public class SimEvent extends Object implements Comparable<SimEvent>
Class representing a simulation event.
Regardless specific event details, every event is defined by the event arrival time and a priority value. The highest priority event is called first.
Modifier and Type | Class and Description |
---|---|
static class |
SimEvent.DestinationModule
Module that will receive the associated event.
|
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_PRIORITY
Default priority for events (higher values give higher priority).
|
static int |
DEFAULT_TYPE
Default type for events.
|
Constructor and Description |
---|
SimEvent(double eventTime,
List<SimAction> actions,
Object object,
SimEvent.DestinationModule destinationModule)
Constructor that allows to generate an event with a custom object and a list of action notifications.
|
SimEvent(double eventTime,
List<SimAction> actions,
SimEvent.DestinationModule destinationModule)
Constructor that allows to generate an event with a list of action notifications.
|
SimEvent(double eventTime,
Object object,
SimEvent.DestinationModule destinationModule)
Constructor that allows to generate an event with a custom object.
|
SimEvent(double eventTime,
SimAction action,
SimEvent.DestinationModule destinationModule)
Constructor that allows to generate an event with an action notification.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(SimEvent e) |
boolean |
contains(SimAction.ActionType actionType)
Returns
true if the event contains an action notification of the
given type. |
boolean |
containsAny(EnumSet<SimAction.ActionType> actionTypes)
Returns
true if the event contains an action notification of
among one of the given types. |
List<SimAction> |
getEventActionList()
Returns the list of action notifications.
|
SimEvent.DestinationModule |
getEventDestinationModule()
Returns the destination module of the event.
|
Object |
getEventObject()
Returns the custom object of the event (may be null).
|
int |
getEventPriority()
Returns the event priority.
|
double |
getEventTime()
Returns the event time.
|
int |
getEventType()
Returns the custom event type.
|
SimEvent |
setEventPriority(int priority)
Sets scheduling priority of the message.
|
SimEvent |
setEventType(int type)
Sets the message kind.
|
String |
toString() |
public static final int DEFAULT_PRIORITY
public static final int DEFAULT_TYPE
public SimEvent(double eventTime, List<SimAction> actions, Object object, SimEvent.DestinationModule destinationModule)
eventTime
- Event timeactions
- List of actions to be notifiedobject
- Custom objectdestinationModule
- Module that will receive the eventpublic SimEvent(double eventTime, List<SimAction> actions, SimEvent.DestinationModule destinationModule)
eventTime
- Event timeactions
- List of actions to be notifieddestinationModule
- Module that will receive the eventpublic SimEvent(double eventTime, Object object, SimEvent.DestinationModule destinationModule)
eventTime
- Event timeobject
- Custom objectdestinationModule
- Module that will receive the eventpublic SimEvent(double eventTime, SimAction action, SimEvent.DestinationModule destinationModule)
eventTime
- Event timeaction
- Action to be notifieddestinationModule
- Module that will receive the eventpublic final int compareTo(SimEvent e)
compareTo
in interface Comparable<SimEvent>
public boolean contains(SimAction.ActionType actionType)
true
if the event contains an action notification of the
given type.actionType
- Type of action notificationtrue
if the event contains an action notification of the given type. Otherwise, false
public boolean containsAny(EnumSet<SimAction.ActionType> actionTypes)
true
if the event contains an action notification of
among one of the given types.actionTypes
- Types of action notificationtrue
if the event contains an action notification of any of the given type. Otherwise, false
public final List<SimAction> getEventActionList()
Returns the list of action notifications.
Important: The returned list is unmodifiable
public final SimEvent.DestinationModule getEventDestinationModule()
Returns the destination module of the event.
public final Object getEventObject()
public final int getEventPriority()
public final double getEventTime()
public final int getEventType()
public final SimEvent setEventPriority(int priority)
priority
- Event priority (the higher, the more priority)public final SimEvent setEventType(int type)
type
- Event typepublic String toString()
toString
in class Object