public abstract class AbstractEvaluationStrategy
extends java.lang.Object
TechnicalSystem
's. Consequently, it has to be extend
in order to create a customized evaluation strategy.Modifier and Type | Field and Description |
---|---|
protected long |
evaluationStart |
protected OptionModelController |
optionModelController |
Constructor and Description |
---|
AbstractEvaluationStrategy(OptionModelController optionModelController)
Instantiates a new AbstractEvaluationStrategy.
|
Modifier and Type | Method and Description |
---|---|
Schedule |
addStateToResults(TechnicalSystemStateEvaluation tsStateEval)
Adds the specified, final TechnicalSystemStateEvaluation state to the result list of
the
EvaluationProcess and returns the created Schedule . |
protected Schedule |
addStateToResults(TechnicalSystemStateEvaluation tsStateEval,
int priority)
Adds the specified, final TechnicalSystemStateEvaluation state to the result list of
the
EvaluationProcess and returns the created Schedule . |
protected void |
calculateAndSetStateCosts(TechnicalSystemStateEvaluation tsse)
Invokes the calculation process for the state costs and sets
the value in the specified
TechnicalSystemStateEvaluation . |
protected TechnicalSystemStateEvaluation |
convertToTechnicalSystemStateEvaluation(TechnicalSystemStateTime tsst)
Converts the specified
TechnicalSystemStateTime or TechnicalSystemState
into a TechnicalSystemStateEvaluation . |
protected EnergyAmount |
copyEnergyAmount(EnergyAmount energyAmount)
Copies the specified energy amount into a new instance.
|
protected EnergyFlowInWatt |
copyEnergyFlowInWatt(EnergyFlowInWatt energyFlowInWatt)
Copies the specified energy flow in watt into a new instance.
|
protected AbstractStorageLoad |
copyStorageLoad(AbstractStorageLoad storageLoad)
Copies the specified
StorageLoadEnergy . |
protected TechnicalSystemState |
copyTechnicalSystemState(TechnicalSystemState tss)
Copies either the specified
TechnicalSystemState or TechnicalSystemStateEvaluation . |
protected TechnicalSystemState |
copyTechnicalSystemState(TechnicalSystemState tss,
boolean copyParent)
Copies either the specified
TechnicalSystemState or TechnicalSystemStateEvaluation . |
void |
executeEvaluation()
Executes the customized evaluation process by calling the abstract
method
runEvaluation() . |
java.util.Vector<TechnicalSystemStateDeltaEvaluation> |
getAllDeltaEvaluationsStartingFromTechnicalSystemState(TechnicalSystemStateEvaluation tsse)
Returns all subsequent delta evaluations for the next possible
TechnicalSystemState 's. |
java.util.Vector<TechnicalSystemStateDeltaEvaluation> |
getAllDeltaEvaluationsStartingFromTechnicalSystemState(TechnicalSystemStateEvaluation tsse,
long predefinedDuration)
Returns all subsequent delta evaluations for the next possible
TechnicalSystemState 's. |
java.util.Vector<TechnicalSystemStateDeltaEvaluation> |
getAllDeltaEvaluationsStartingFromTechnicalSystemState(TechnicalSystemStateEvaluation tsse,
long predefinedDuration,
boolean isReCreateExistingEdges)
Returns all subsequent delta evaluations for the next possible
TechnicalSystemState 's. |
protected java.util.Vector<TechnicalSystemState> |
getAllPossibleSubsequentStatesByDefinition(TechnicalSystemState tss)
Returns all possible subsequent
TechnicalSystemState 's that are reachable just by the
definition of the State 's and the SystemVariableDefinition of the TechnicalSystem . |
protected java.util.Vector<TechnicalSystemState> |
getAllPossibleSubsequentStatesByDefinition(TechnicalSystemState tss,
long predefinedDuration)
Returns all possible subsequent
TechnicalSystemState 's that are reachable just by the
definition of the State 's and the SystemVariableDefinition of the TechnicalSystem . |
protected CostFunctionDataSeries |
getCostFunctionHistory(java.lang.String domain,
Connectivity connectivity)
Returns the actual
CostFunctionDataSeries for the specified domain and the Connectivity
of the current CostModel , regardless if this is a calculated or a discrete cost function. |
CostModel |
getCostModel()
Returns the current
CostModel . |
abstract java.util.Vector<javax.swing.JComponent> |
getCustomToolBarElements()
Should return your custom tool bar elements for the evaluation.
|
protected EnergyUnitFactorPrefixSI |
getDefaultSIPrefix()
Returns the default SI prefix for the evaluation.
|
protected TimeUnit |
getDefaultTimeUnit()
Returns the default
TimeUnit for the evaluation. |
long |
getEndTime()
Returns the evaluation end time.
|
EvaluationProcess |
getEvaluationProcess()
Returns the current
EvaluationProcess . |
ScheduleList |
getEvaluationResults()
Returns the evaluation results as instance of a
ScheduleList . |
EvaluationSettings |
getEvaluationSettings()
Returns the current
EvaluationSettings . |
java.lang.Thread |
getEvaluationThread()
Returns the current
EvaluationThread . |
EvaluationTimeRangeReminder |
getEvaluationTimeRangeReminder()
Returns the
EvaluationTimeRangeReminder that contains CostFunctionDataSeries 's
and InputMeasurement 's for the current evaluation time range. |
protected TechnicalSystemStateEvaluation |
getFirstTechnicalSystemStateEvaluationWithEqualState(TechnicalSystemStateEvaluation tsse)
Returns the first
TechnicalSystemStateEvaluation with the same State as the specified one. |
protected EvaluationGraph |
getGraphForDeltaCosts()
Returns the graph for delta costs.
|
protected EvaluationGraph |
getGraphForStateVariability()
Returns the graph for state variability.
|
TechnicalSystemStateEvaluation |
getInitialTechnicalSystemStateEvaluation()
Returns the initial
TechnicalSystemStateEvaluation derived from the graph for costs over time, where the
further evaluation has to start at. |
TechnicalSystemStateEvaluation |
getNextTechnicalSystemStateEvaluation(TechnicalSystemStateEvaluation tsseOld,
TechnicalSystemStateDeltaEvaluation tssDeltaEvaluation)
Applies, based on the specified old
TechnicalSystemStateDeltaEvaluation , the given
TechnicalSystemStateDeltaEvaluation and returns the resulting new TechnicalSystemStateEvaluation . |
NodeStatesResolver |
getNodeStateResolver()
Gets the node state resolver.
|
AbstractOptionModelCalculation |
getOptionModelCalculation()
Returns the current OptionModelCalculation .
|
long |
getStartTime()
Returns the evaluation start time.
|
protected long |
getStateDurationFromTechnicalSystemState(TechnicalSystemState tss)
Derives the state duration (in milliseconds) from a technical system state (with the current option model controller).
|
protected TechnicalInterfaceConfiguration |
getTechnicalInterfaceConfiguration()
Gets the technical interface configuration derived by the initial TechnicalSystemState.
|
boolean |
hasStateCostFunction()
Checks for a defined state cost function.
|
protected boolean |
isAvailableOptionModelCalculation()
Checks if the systems defined option model calculation is available.
|
protected boolean |
isConstantStateSinceGlobalTime(TechnicalSystemStateEvaluation tsse,
long globalTimeSince)
Checks if the specified
TechnicalSystemStateEvaluation is in a row of constant State 's
since the specified global time. |
protected boolean |
isEnabledPrintToConsole()
Checks if prints to the console are enabled or not.
|
boolean |
isRealTimeStrategyOrPartOfRealTimeStrategy()
Checks if the current strategy is a real time strategy or part of real time strategy
(e.g. a
MemberEvaluationStrategy that is used by a AbstractGroupEvaluationStrategyRT ). |
protected boolean |
isStopEvaluation()
Checks if the evaluation is to stop now.
|
void |
print(java.lang.String message,
boolean isError)
Prints the specified message or error to the console, if they are enabled.
|
void |
printlnGlobalTime(long timeToPrint,
java.lang.String prefixText,
java.lang.String suffixText)
Prints the specified global time.
|
void |
printlnGlobalTime(long timeToPrint,
java.lang.String pattern,
java.lang.String prefixText,
java.lang.String suffixText)
Prints the specified global time.
|
protected void |
recursivelyCreateEvaluationGraphForCostsOverTime()
Recursively creates the evaluation graph for costs over time starting from the
initial
TechnicalSystemStateEvaluation to the end of the evaluation period. |
protected void |
recursivelyCreateEvaluationGraphForCostsOverTime(TechnicalSystemStateEvaluation tsseStart,
long timeToStop)
Recursively creates the evaluation graph for costs over time starting from the specified
TechnicalSystemStateEvaluation to the specified end time. |
void |
resetInitialTechnicalSystemStateEvaluation()
Reset initial technical system state evaluation.
|
TechnicalSystemStateEvaluation |
resetScheduleAndCalculationsStartingFrom(TechnicalSystemStateEvaluation tsseSchedule,
long pointInTime)
/**
Resets the local schedule and the calculations starting from the specified point in time.
|
abstract void |
runEvaluation()
Runs the customized evaluation process.
|
void |
setEnablePrintToConsole(boolean enablePrintToConsole)
Sets the prints to the console enabled or not.
|
void |
setEvaluationThread(java.lang.Thread currentEvaluationThread)
Sets the reference to the current
EvaluationThread . |
protected void |
setGraphForDeltaCosts(EvaluationGraph newGraphForEvaluationByDeltaCosts)
Sets the graph for delta costs.
|
protected void |
setGraphForStateVariability(EvaluationGraph newGraphForStateVariability)
Sets the graph for state variability.
|
void |
setInitialTechnicalSystemStateEvaluation(TechnicalSystemStateEvaluation newInitialTechnicalSystemStateEvaluation)
Sets the initial technical system state evaluation.
|
void |
stopEvaluation()
Sets to stop the current evaluation.
|
protected OptionModelController optionModelController
protected long evaluationStart
public AbstractEvaluationStrategy(OptionModelController optionModelController)
optionModelController
- the option model controllerprotected boolean isAvailableOptionModelCalculation()
public AbstractOptionModelCalculation getOptionModelCalculation()
public NodeStatesResolver getNodeStateResolver()
public void setEvaluationThread(java.lang.Thread currentEvaluationThread)
EvaluationThread
.currentEvaluationThread
- the evaluation thread used within this instance of the evaluation strategypublic java.lang.Thread getEvaluationThread()
EvaluationThread
.public EvaluationProcess getEvaluationProcess()
EvaluationProcess
.public ScheduleList getEvaluationResults()
ScheduleList
.public EvaluationSettings getEvaluationSettings()
EvaluationSettings
.public boolean hasStateCostFunction()
protected CostFunctionDataSeries getCostFunctionHistory(java.lang.String domain, Connectivity connectivity)
CostFunctionDataSeries
for the specified domain and the Connectivity
of the current CostModel
, regardless if this is a calculated or a discrete cost function.domain
- the domainconnectivity
- the connectivityprotected EnergyUnitFactorPrefixSI getDefaultSIPrefix()
protected TimeUnit getDefaultTimeUnit()
TimeUnit
for the evaluation.public TechnicalSystemStateEvaluation getInitialTechnicalSystemStateEvaluation()
TechnicalSystemStateEvaluation
derived from the graph for costs over time, where the
further evaluation has to start at. This considers also the case that an initial TechnicalSystemState
was
configured whose state time (see TechnicalSystemState.getStateTime()
) is smaller than the duration of the
state (see State.getDuration()
).TechnicalSystemStateEvaluation
, where the further evaluation has to start at.public void setInitialTechnicalSystemStateEvaluation(TechnicalSystemStateEvaluation newInitialTechnicalSystemStateEvaluation)
newInitialTechnicalSystemStateEvaluation
- the new initial technical system state evaluationpublic void resetInitialTechnicalSystemStateEvaluation()
public TechnicalSystemStateEvaluation resetScheduleAndCalculationsStartingFrom(TechnicalSystemStateEvaluation tsseSchedule, long pointInTime)
tsseSchedule
- the TechnicalSystemStateEvaluation
that represents the schedulepointInTime
- the point in time from which all results have to be removedpublic long getStartTime()
public long getEndTime()
public EvaluationTimeRangeReminder getEvaluationTimeRangeReminder()
EvaluationTimeRangeReminder
that contains CostFunctionDataSeries
's
and InputMeasurement
's for the current evaluation time range.
In order to accelerate the evaluation, it is strongly recommended to use this method
for accessing InputMeasurement
's and CostFunctionDataSeries
's!protected TechnicalInterfaceConfiguration getTechnicalInterfaceConfiguration()
protected TechnicalSystemState copyTechnicalSystemState(TechnicalSystemState tss)
TechnicalSystemState
or TechnicalSystemStateEvaluation
.tss
- the actual TechnicalSystemState
or TechnicalSystemStateEvaluation
to copyTechnicalSystemState
or TechnicalSystemStateEvaluation
protected TechnicalSystemState copyTechnicalSystemState(TechnicalSystemState tss, boolean copyParent)
TechnicalSystemState
or TechnicalSystemStateEvaluation
.tss
- the actual TechnicalSystemState
or TechnicalSystemStateEvaluation
to copycopyParent
- set true, if the parent of a TechnicalSystemStateEvaluation
should be copied tooTechnicalSystemState
or TechnicalSystemStateEvaluation
protected TechnicalSystemStateEvaluation convertToTechnicalSystemStateEvaluation(TechnicalSystemStateTime tsst)
TechnicalSystemStateTime
or TechnicalSystemState
into a TechnicalSystemStateEvaluation
.tsst
- the TechnicalSystemStateTimeprotected EnergyFlowInWatt copyEnergyFlowInWatt(EnergyFlowInWatt energyFlowInWatt)
energyFlowInWatt
- the energy flow in wattprotected EnergyAmount copyEnergyAmount(EnergyAmount energyAmount)
energyAmount
- the energy amountprotected AbstractStorageLoad copyStorageLoad(AbstractStorageLoad storageLoad)
StorageLoadEnergy
.storageLoad
- the storage loads instance to copypublic Schedule addStateToResults(TechnicalSystemStateEvaluation tsStateEval)
EvaluationProcess
and returns the created Schedule
.tsStateEval
- the TechnicalSystemStateEvaluationSchedule
EvaluationProcess.addEvaluationResult(Schedule)
protected Schedule addStateToResults(TechnicalSystemStateEvaluation tsStateEval, int priority)
EvaluationProcess
and returns the created Schedule
.tsStateEval
- the TechnicalSystemStateEvaluationpriority
- the priority of the resultEvaluationProcess.addEvaluationResult(Schedule)
public boolean isRealTimeStrategyOrPartOfRealTimeStrategy()
MemberEvaluationStrategy
that is used by a AbstractGroupEvaluationStrategyRT
).public abstract java.util.Vector<javax.swing.JComponent> getCustomToolBarElements()
public abstract void runEvaluation()
public void executeEvaluation()
runEvaluation()
. This method contains also a try catch
block in order to prevent faulty configurations and blocking of further
executions and functions.public void stopEvaluation()
protected boolean isStopEvaluation()
public void print(java.lang.String message, boolean isError)
message
- the messageisError
- the is errorisEnabledPrintToConsole()
,
setEnablePrintToConsole(boolean)
public void setEnablePrintToConsole(boolean enablePrintToConsole)
enablePrintToConsole
- the new prints the to consoleprint(String, boolean)
protected boolean isEnabledPrintToConsole()
print(String, boolean)
protected EvaluationGraph getGraphForStateVariability()
protected void setGraphForStateVariability(EvaluationGraph newGraphForStateVariability)
newGraphForStateVariability
- the new graph for state variabilityprotected java.util.Vector<TechnicalSystemState> getAllPossibleSubsequentStatesByDefinition(TechnicalSystemState tss)
TechnicalSystemState
's that are reachable just by the
definition of the State
's and the SystemVariableDefinition
of the TechnicalSystem
.State
the possible StateTransition
's will be considered
as well as the variations that are defined with the RangeVariable
's in the actual State
.Duration
's of StateTransition
's
or loads of storages will not be considered here!tss
- the current TechnicalSystemState
State.getStateTransitions()
,
State.getStateEvaluationRanges()
,
RangeVariable
,
RangeBoolean
,
RangeInteger
,
RangeDouble
protected java.util.Vector<TechnicalSystemState> getAllPossibleSubsequentStatesByDefinition(TechnicalSystemState tss, long predefinedDuration)
TechnicalSystemState
's that are reachable just by the
definition of the State
's and the SystemVariableDefinition
of the TechnicalSystem
.State
the possible StateTransition
's will be considered
as well as the variations that are defined with the RangeVariable
's in the actual State
.Duration
's of StateTransition
's
or loads of storages will not be considered here!tss
- the current TechnicalSystemState
predefinedDuration
- the predefined durationState.getStateTransitions()
,
State.getStateEvaluationRanges()
,
RangeVariable
,
RangeBoolean
,
RangeInteger
,
RangeDouble
protected EvaluationGraph getGraphForDeltaCosts()
protected void setGraphForDeltaCosts(EvaluationGraph newGraphForEvaluationByDeltaCosts)
newGraphForEvaluationByDeltaCosts
- the new graph for delta costspublic java.util.Vector<TechnicalSystemStateDeltaEvaluation> getAllDeltaEvaluationsStartingFromTechnicalSystemState(TechnicalSystemStateEvaluation tsse)
TechnicalSystemState
's.tsse
- the TechnicalSystemStateEvaluation
public java.util.Vector<TechnicalSystemStateDeltaEvaluation> getAllDeltaEvaluationsStartingFromTechnicalSystemState(TechnicalSystemStateEvaluation tsse, long predefinedDuration)
TechnicalSystemState
's.tsse
- the TechnicalSystemStateEvaluation
predefinedDuration
- the predefined duration in milliseconds that is to be used for the next stepspublic java.util.Vector<TechnicalSystemStateDeltaEvaluation> getAllDeltaEvaluationsStartingFromTechnicalSystemState(TechnicalSystemStateEvaluation tsse, long predefinedDuration, boolean isReCreateExistingEdges)
TechnicalSystemState
's.tsse
- the TechnicalSystemStateEvaluation
predefinedDuration
- the predefined duration in milliseconds that is to be used for the next stepsisReCreateExistingEdges
- set true, if available edges should be recreatedpublic TechnicalSystemStateEvaluation getNextTechnicalSystemStateEvaluation(TechnicalSystemStateEvaluation tsseOld, TechnicalSystemStateDeltaEvaluation tssDeltaEvaluation)
TechnicalSystemStateDeltaEvaluation
, the given
TechnicalSystemStateDeltaEvaluation
and returns the resulting new TechnicalSystemStateEvaluation
.tsseOld
- the initial/old TechnicalSystemStateDeltaEvaluation
tssDeltaEvaluation
- the TechnicalSystemStateDeltaEvaluation
to applyTechnicalSystemStateEvaluation
protected void recursivelyCreateEvaluationGraphForCostsOverTime()
TechnicalSystemStateEvaluation
to the end of the evaluation period.protected void recursivelyCreateEvaluationGraphForCostsOverTime(TechnicalSystemStateEvaluation tsseStart, long timeToStop)
TechnicalSystemStateEvaluation
to the specified end time.tsseStart
- the TechnicalSystemStateEvaluation to start attimeToStop
- the time to stop with the creation of the graphprotected TechnicalSystemStateEvaluation getFirstTechnicalSystemStateEvaluationWithEqualState(TechnicalSystemStateEvaluation tsse)
TechnicalSystemStateEvaluation
with the same State
as the specified one.tsse
- the TechnicalSystemStateEvaluation
State
TechnicalSystemStateEvaluation
,
TechnicalSystemStateEvaluation.getParent()
protected long getStateDurationFromTechnicalSystemState(TechnicalSystemState tss)
tss
- the technical system stateprotected boolean isConstantStateSinceGlobalTime(TechnicalSystemStateEvaluation tsse, long globalTimeSince)
TechnicalSystemStateEvaluation
is in a row of constant State
's
since the specified global time. This method can be used in order to check if a minimum duration for
a StateTransition
is expired or not;tsse
- the TechnicalSystemStateEvaluationglobalTimeSince
- the global time sinceTechnicalSystemStateEvaluation.getParent()
protected void calculateAndSetStateCosts(TechnicalSystemStateEvaluation tsse)
TechnicalSystemStateEvaluation
.tsse
- the TechnicalSystemStateEvaluation
, where the state costs should be setpublic void printlnGlobalTime(long timeToPrint, java.lang.String prefixText, java.lang.String suffixText)
timeToPrint
- the time to printprefixText
- the prefix textsuffixText
- the suffix textpublic void printlnGlobalTime(long timeToPrint, java.lang.String pattern, java.lang.String prefixText, java.lang.String suffixText)
timeToPrint
- the time to printpattern
- the patternprefixText
- the prefix textsuffixText
- the suffix text