public class EntityInvokedOperatorController extends Object implements IEntityInvokedOperatorController
Constructor and Description |
---|
EntityInvokedOperatorController() |
Modifier and Type | Method and Description |
---|---|
IEntityInvokedOperatorController |
copy()
Copies the
IEntityInvokedOperatorController . |
int |
getBenefitCounter()
Gets the counter how many times no lower
costs have been achieved by using an IOperator . |
double |
getCostAdvantage()
Gets the cost that was be saved by using the last beneficial
Operator . |
double |
getLastBeneficialCostAdvantage()
Gets the amount of
cost that was saved by using the last beneficial Operator . |
Optional<com.dna.jopt.revision.operator.IOperator> |
getLastBeneficialInvokedOperator()
Gets the last
IOperator which realized a cost advantage . |
Optional<com.dna.jopt.revision.operator.IOperator> |
getLastInvokedOperator()
Gets the last invoked
IOperator . |
void |
setCostAfterInvocation(double costAfterInvocation)
Updates the last invoked
Operator and the last joined cost if said Operator proved to be
beneficial for the cost . |
void |
setLastBeneficialJoinedCost(double lastBeneficialJoinedCost) |
void |
setLastBeneficialJoinedCostAfterInvocation(double lastBeneficialJoinedCostAfterInvocation) |
void |
setLastInvokedOperator(com.dna.jopt.revision.operator.IOperator op)
Sets the last invoked
IOperator . |
void |
setLastJoinedCost(double lastJoinedCost)
Sets the
cost before the new IOperator was invoked. |
public Optional<com.dna.jopt.revision.operator.IOperator> getLastInvokedOperator()
IEntityInvokedOperatorController
IOperator
.getLastInvokedOperator
in interface IEntityInvokedOperatorController
public Optional<com.dna.jopt.revision.operator.IOperator> getLastBeneficialInvokedOperator()
IEntityInvokedOperatorController
IOperator
which realized a cost advantage
.
If no such Operator
was used, returns an empty Optional
.
getLastBeneficialInvokedOperator
in interface IEntityInvokedOperatorController
Operator
public void setLastInvokedOperator(com.dna.jopt.revision.operator.IOperator op)
IEntityInvokedOperatorController
IOperator
.setLastInvokedOperator
in interface IEntityInvokedOperatorController
op
- the iOperator last usedpublic void setLastJoinedCost(double lastJoinedCost)
IEntityInvokedOperatorController
cost
before the new IOperator
was invoked.setLastJoinedCost
in interface IEntityInvokedOperatorController
lastJoinedCost
- the double cost before the Operator
public void setLastBeneficialJoinedCost(double lastBeneficialJoinedCost)
public void setLastBeneficialJoinedCostAfterInvocation(double lastBeneficialJoinedCostAfterInvocation)
public void setCostAfterInvocation(double costAfterInvocation)
IEntityInvokedOperatorController
Operator
and the last joined cost
if said Operator
proved to be
beneficial for the cost
.setCostAfterInvocation
in interface IEntityInvokedOperatorController
costAfterInvocation
- the double new cost after the Operator
public int getBenefitCounter()
IEntityInvokedOperatorController
costs
have been achieved by using an IOperator
.
This counter resets when a beneficial Operator
has been invoked and IEntityInvokedOperatorController.setCostAfterInvocation(double)
has been called.
getBenefitCounter
in interface IEntityInvokedOperatorController
public double getCostAdvantage()
IEntityInvokedOperatorController
Operator
.getCostAdvantage
in interface IEntityInvokedOperatorController
Operator
public double getLastBeneficialCostAdvantage()
IEntityInvokedOperatorController
cost
that was saved by using the last beneficial Operator
.getLastBeneficialCostAdvantage
in interface IEntityInvokedOperatorController
public IEntityInvokedOperatorController copy()
IEntityInvokedOperatorController
IEntityInvokedOperatorController
.
This is used when copying an IEntity
since the history of the
cost in the OperatorController
is needed.
copy
in interface IEntityInvokedOperatorController
Copyright © 2017–2023 DNA Evolutions GmbH. All rights reserved.