public abstract class ICombinedEventGenerator extends IEventGenerator
Abstract class providing an event generator that is able to combine
existing event generators into a common one. All the event generators are
called for each method corresponding to the IEventGenerator 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 generator.
Important: Classes for event generators must be in the classpath
of Net2Plan. Otherwise, a NoClassDefFoundError exception would appear.
| Modifier and Type | Field and Description |
|---|---|
IEventGenerator[] |
eventGenerators
Reference to the set of event generators.
|
| Constructor and Description |
|---|
ICombinedEventGenerator(IEventGenerator... eventGenerators)
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 IEventGenerator[] eventGenerators
public ICombinedEventGenerator(IEventGenerator... eventGenerators)
eventGenerators - Events generators to be combinedpublic String finish(StringBuilder output,
double simTime)
IEventGeneratorfinish in class IEventGeneratoroutput - Container for the reportsimTime - Current simulation timenull, or an empty output to omit it)public void finishTransitory(double simTime)
IEventGeneratorfinishTransitory in class IEventGeneratorsimTime - Current timepublic String getDescription()
IEventGeneratorgetDescription in class IEventGeneratorpublic List<Triple<String,String,String>> getParameters()
IEventGeneratorReturns 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 IEventGeneratorpublic void initialize(NetPlan initialNetPlan, NetPlan currentNetPlan, Map<String,String> algorithmParameters, Map<String,String> simulationParameters, Map<String,String> net2planParameters)
IEventGeneratorinitialize in class IEventGeneratorinitialNetPlan - 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)
IEventGeneratorscheduleEvent
method.processEvent in class IEventGeneratorcurrentNetPlan - Current network planevent - Current event to be processed