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
.int
Gets the counter how many times no lowercosts
have been achieved by using anIOperator
.double
Gets the cost that was be saved by using the last beneficialOperator
.double
Gets the amount ofcost
that was saved by using the last beneficialOperator
.Optional<com.dna.jopt.revision.operator.IOperator>
Gets the lastIOperator
which realized acost advantage
.Optional<com.dna.jopt.revision.operator.IOperator>
Gets the last invokedIOperator
.void
setCostAfterInvocation
(double costAfterInvocation) Updates the last invokedOperator
and the lastjoined cost
if saidOperator
proved to be beneficial for thecost
.void
setLastInvokedOperator
(com.dna.jopt.revision.operator.IOperator op) Sets the last invokedIOperator
.void
setLastJoinedCost
(double lastJoinedCost) Sets thecost
before the newIOperator
was 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 thecost
before the newIOperator
was invoked.- Parameters:
lastJoinedCost
- the double cost before theOperator
-
setCostAfterInvocation
void setCostAfterInvocation(double costAfterInvocation) Updates the last invokedOperator
and the lastjoined cost
if saidOperator
proved 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
IEntity
since the history of the cost in theOperatorController
is needed.- Returns:
- a copy of this Object
-
getLastBeneficialInvokedOperator
Optional<com.dna.jopt.revision.operator.IOperator> getLastBeneficialInvokedOperator()Gets the lastIOperator
which realized acost advantage
.If no such
Operator
was used, returns anempty Optional
.- Returns:
- the last beneficial
Operator
-
getLastBeneficialCostAdvantage
double getLastBeneficialCostAdvantage()Gets the amount ofcost
that was saved by using the last beneficialOperator
.- Returns:
- the saved cost
-
getBenefitCounter
int getBenefitCounter()Gets the counter how many times no lowercosts
have been achieved by using anIOperator
.This counter resets when a beneficial
Operator
has been invoked andsetCostAfterInvocation(double)
has been called.- Returns:
- the number of times no benefit has been achieved
-