rails.game.specific._18AL
Class NamedTrainRevenueModifier

java.lang.Object
  extended by rails.game.specific._18AL.NamedTrainRevenueModifier
All Implemented Interfaces:
RevenueDynamicModifier, RevenueStaticModifier, ConfigurableComponentI

public class NamedTrainRevenueModifier
extends java.lang.Object
implements RevenueStaticModifier, RevenueDynamicModifier, ConfigurableComponentI


Constructor Summary
NamedTrainRevenueModifier()
           
 
Method Summary
 void adjustOptimalRun(java.util.List<RevenueTrainRun> optimalRuns)
          allows to adjust the run list of the optimal train run output
 void configureFromXML(Tag tag)
          Instructs the component to configure itself from the provided XML element.
 int evaluationValue(java.util.List<RevenueTrainRun> runs, boolean optimalRuns)
          returns the value used for evaluation (at the runs supplied)
 void finishConfiguration(GameManagerI parent)
          This method is intended to be called for each configurable component, to perforn any initialisation activities that require any other components to be initialised first.
 void modifyCalculator(RevenueAdapter revenueAdapter)
           
 int predictionValue()
          returns the value used for prediction
 boolean prepareModifier(RevenueAdapter revenueAdapter)
          after the setup of the revenueAdapter, but before the actual calculation if return is false => deactivate
 java.lang.String prettyPrint(RevenueAdapter revenueAdapter)
          returns the results as pretty prints
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamedTrainRevenueModifier

public NamedTrainRevenueModifier()
Method Detail

configureFromXML

public void configureFromXML(Tag tag)
                      throws ConfigurationException
Description copied from interface: ConfigurableComponentI
Instructs the component to configure itself from the provided XML element.

Specified by:
configureFromXML in interface ConfigurableComponentI
Throws:
ConfigurationException

finishConfiguration

public void finishConfiguration(GameManagerI parent)
                         throws ConfigurationException
Description copied from interface: ConfigurableComponentI
This method is intended to be called for each configurable component, to perforn any initialisation activities that require any other components to be initialised first. This includes creating any required relationships to other configured components and objects.

This method should be called where necessary after all XML file parsing has completed, so that all objects that need to be related to do exist.

Specified by:
finishConfiguration in interface ConfigurableComponentI
Parameters:
parent - The 'parent' configurable component is passed to allow the 'child' to access any other object without the need to resort to static calls where possible.
Throws:
ConfigurationException

modifyCalculator

public void modifyCalculator(RevenueAdapter revenueAdapter)
Specified by:
modifyCalculator in interface RevenueStaticModifier

prepareModifier

public boolean prepareModifier(RevenueAdapter revenueAdapter)
Description copied from interface: RevenueDynamicModifier
after the setup of the revenueAdapter, but before the actual calculation if return is false => deactivate

Specified by:
prepareModifier in interface RevenueDynamicModifier

predictionValue

public int predictionValue()
Description copied from interface: RevenueDynamicModifier
returns the value used for prediction

Specified by:
predictionValue in interface RevenueDynamicModifier

evaluationValue

public int evaluationValue(java.util.List<RevenueTrainRun> runs,
                           boolean optimalRuns)
Description copied from interface: RevenueDynamicModifier
returns the value used for evaluation (at the runs supplied)

Specified by:
evaluationValue in interface RevenueDynamicModifier

adjustOptimalRun

public void adjustOptimalRun(java.util.List<RevenueTrainRun> optimalRuns)
Description copied from interface: RevenueDynamicModifier
allows to adjust the run list of the optimal train run output

Specified by:
adjustOptimalRun in interface RevenueDynamicModifier

prettyPrint

public java.lang.String prettyPrint(RevenueAdapter revenueAdapter)
Description copied from interface: RevenueDynamicModifier
returns the results as pretty prints

Specified by:
prettyPrint in interface RevenueDynamicModifier