Interface IEntityInvokedOperatorController
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
EntityInvokedOperatorController
This interface provides methods that help to track the last invoked
IOperator, which last
Operator was able to realize lower costs and by what amount.- Since:
- 17/02/2020
- Version:
- 17/02/2020
- Author:
- DNA
-
Method Summary
Modifier and TypeMethodDescriptioncopy()Copies theIEntityInvokedOperatorController.intGets the counter how many times no lowercostshave been achieved by using anIOperator.doubleGets the cost that was be saved by using the last beneficialOperator.doubleGets the amount ofcostthat was saved by using the last beneficialOperator.Optional<com.dna.jopt.revision.operator.IOperator>Gets the lastIOperatorwhich realized acost advantage.Optional<com.dna.jopt.revision.operator.IOperator>Gets the last invokedIOperator.voidsetCostAfterInvocation(double costAfterInvocation) Updates the last invokedOperatorand the lastjoined costif saidOperatorproved to be beneficial for thecost.voidsetLastInvokedOperator(com.dna.jopt.revision.operator.IOperator op) Sets the last invokedIOperator.voidsetLastJoinedCost(double lastJoinedCost) Sets thecostbefore the newIOperatorwas invoked.
-
Method Details
-
getLastInvokedOperator
Optional<com.dna.jopt.revision.operator.IOperator> getLastInvokedOperator()Gets the last invokedIOperator.- Returns:
- the Operator
-
setLastInvokedOperator
void setLastInvokedOperator(com.dna.jopt.revision.operator.IOperator op) Sets the last invokedIOperator.- Parameters:
op- the iOperator last used
-
setLastJoinedCost
void setLastJoinedCost(double lastJoinedCost) Sets thecostbefore the newIOperatorwas invoked.- Parameters:
lastJoinedCost- the double cost before theOperator
-
setCostAfterInvocation
void setCostAfterInvocation(double costAfterInvocation) Updates the last invokedOperatorand the lastjoined costif saidOperatorproved to be beneficial for thecost.- Parameters:
costAfterInvocation- the double new cost after theOperator
-
getCostAdvantage
double getCostAdvantage()Gets the cost that was be saved by using the last beneficialOperator.- Returns:
- the cost advantage of using said
Operator
-
copy
Copies theIEntityInvokedOperatorController.This is used when copying an
IEntitysince the history of the cost in theOperatorControlleris needed.- Returns:
- a copy of this Object
-
getLastBeneficialInvokedOperator
Optional<com.dna.jopt.revision.operator.IOperator> getLastBeneficialInvokedOperator()Gets the lastIOperatorwhich realized acost advantage.If no such
Operatorwas used, returns anempty Optional.- Returns:
- the last beneficial
Operator
-
getLastBeneficialCostAdvantage
double getLastBeneficialCostAdvantage()Gets the amount ofcostthat was saved by using the last beneficialOperator.- Returns:
- the saved cost
-
getBenefitCounter
int getBenefitCounter()Gets the counter how many times no lowercostshave been achieved by using anIOperator.This counter resets when a beneficial
Operatorhas been invoked andsetCostAfterInvocation(double)has been called.- Returns:
- the number of times no benefit has been achieved
-