public abstract class ICombinedEventProcessor extends IEventProcessor
Abstract class providing an event processor that is able to combine
existing event processors into a common one. All the event generators are
called for each method corresponding to the IEventProcessor class,
i.e. initialize, finish..., in the order defined in the constructor. The only
method to be implemented is processEvent(),
which would send the event to the specific event processor.
Important: Classes for event processors must be in the classpath
of Net2Plan. Otherwise, a NoClassDefFoundError exception should appear.
| Modifier and Type | Field and Description |
|---|---|
IEventProcessor[] |
eventProcessors
Reference to the set of event processors.
|
| Constructor and Description |
|---|
ICombinedEventProcessor(IEventProcessor... eventProcessors)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
String |
finish(StringBuilder output,
double simTime)
Returns an algorithm-specific report.
|
void |
finishTransitory(double simTime)
Performs some transitory-finished action.
|
String |
getDescription()
Returns the description.
|
List<Triple<String,String,String>> |
getParameters()
Returns the list of required parameters, where the first item of each element
is the parameter name, the second one is the parameter value, and the third
one is the parameter description.
|
void |
initialize(NetPlan initialNetPlan,
NetPlan currentNetPlan,
Map<String,String> algorithmParameters,
Map<String,String> simulationParameters,
Map<String,String> net2planParameters)
Initializes the algorithm (i.e. reading input parameters).
|
abstract void |
processEvent(NetPlan currentNetPlan,
SimEvent event)
Processes the next event in the future event list.
|
endSimulation, endTransitory, scheduleEventpublic final IEventProcessor[] eventProcessors
public ICombinedEventProcessor(IEventProcessor... eventProcessors)
eventProcessors - Events processors to be combinedpublic String finish(StringBuilder output,
double simTime)
IEventProcessorfinish in class IEventProcessoroutput - Container for the reportsimTime - Current simulation timenull, or an empty output to omit it)public void finishTransitory(double simTime)
IEventProcessorfinishTransitory in class IEventProcessorsimTime - Current timepublic String getDescription()
IEventProcessorgetDescription in class IEventProcessorpublic List<Triple<String,String,String>> getParameters()
IEventProcessorReturns the list of required parameters, where the first item of each element is the parameter name, the second one is the parameter value, and the third one is the parameter description.
It is possible to define type-specific parameters if the default value is set according to the following rules (but user is responsible of checking in its own code):
.class or .jar file where the code is located, the class name,
and a set of parameters (pair of key-values separated by commas, where individual
key and value are separated with an equal symbol. The same applies to reports (#report#),
event generators (#eventGenerator#) and event processors (#eventProcessor#).getParameters in class IEventProcessorpublic void initialize(NetPlan initialNetPlan, NetPlan currentNetPlan, Map<String,String> algorithmParameters, Map<String,String> simulationParameters, Map<String,String> net2planParameters)
IEventProcessorinitialize in class IEventProcessorinitialNetPlan - Initial network plancurrentNetPlan - Current network planalgorithmParameters - A key-value map with specific algorithm parameters.simulationParameters - A key-value map with simulation parametersnet2planParameters - A key-value map with Net2Plan-wide configuration optionspublic abstract void processEvent(NetPlan currentNetPlan, SimEvent event)
IEventProcessorscheduleEvent
method.processEvent in class IEventProcessorcurrentNetPlan - Current network planevent - Current event to be processed