Class EntityInvokedOperatorController
java.lang.Object
com.dna.jopt.member.bucket.entity.controller.invokedoperator.EntityInvokedOperatorController
- All Implemented Interfaces:
IEntityInvokedOperatorController
,Serializable
public class EntityInvokedOperatorController
extends Object
implements IEntityInvokedOperatorController
- See Also:
-
Constructor Summary
-
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
setLastBeneficialJoinedCost
(double lastBeneficialJoinedCost) void
setLastBeneficialJoinedCostAfterInvocation
(double lastBeneficialJoinedCostAfterInvocation) void
setLastInvokedOperator
(com.dna.jopt.revision.operator.IOperator op) Sets the last invokedIOperator
.void
setLastJoinedCost
(double lastJoinedCost) Sets thecost
before the newIOperator
was invoked.
-
Constructor Details
-
EntityInvokedOperatorController
public EntityInvokedOperatorController()
-
-
Method Details
-
getLastInvokedOperator
Description copied from interface:IEntityInvokedOperatorController
Gets the last invokedIOperator
.- Specified by:
getLastInvokedOperator
in interfaceIEntityInvokedOperatorController
- Returns:
- the Operator
-
getLastBeneficialInvokedOperator
Description copied from interface:IEntityInvokedOperatorController
Gets the lastIOperator
which realized acost advantage
.If no such
Operator
was used, returns anempty Optional
.- Specified by:
getLastBeneficialInvokedOperator
in interfaceIEntityInvokedOperatorController
- Returns:
- the last beneficial
Operator
-
setLastInvokedOperator
public void setLastInvokedOperator(com.dna.jopt.revision.operator.IOperator op) Description copied from interface:IEntityInvokedOperatorController
Sets the last invokedIOperator
.- Specified by:
setLastInvokedOperator
in interfaceIEntityInvokedOperatorController
- Parameters:
op
- the iOperator last used
-
setLastJoinedCost
public void setLastJoinedCost(double lastJoinedCost) Description copied from interface:IEntityInvokedOperatorController
Sets thecost
before the newIOperator
was invoked.- Specified by:
setLastJoinedCost
in interfaceIEntityInvokedOperatorController
- Parameters:
lastJoinedCost
- the double cost before theOperator
-
setLastBeneficialJoinedCost
public void setLastBeneficialJoinedCost(double lastBeneficialJoinedCost) -
setLastBeneficialJoinedCostAfterInvocation
public void setLastBeneficialJoinedCostAfterInvocation(double lastBeneficialJoinedCostAfterInvocation) -
setCostAfterInvocation
public void setCostAfterInvocation(double costAfterInvocation) Description copied from interface:IEntityInvokedOperatorController
Updates the last invokedOperator
and the lastjoined cost
if saidOperator
proved to be beneficial for thecost
.- Specified by:
setCostAfterInvocation
in interfaceIEntityInvokedOperatorController
- Parameters:
costAfterInvocation
- the double new cost after theOperator
-
getBenefitCounter
public int getBenefitCounter()Description copied from interface:IEntityInvokedOperatorController
Gets the counter how many times no lowercosts
have been achieved by using anIOperator
.This counter resets when a beneficial
Operator
has been invoked andIEntityInvokedOperatorController.setCostAfterInvocation(double)
has been called.- Specified by:
getBenefitCounter
in interfaceIEntityInvokedOperatorController
- Returns:
- the number of times no benefit has been achieved
-
getCostAdvantage
public double getCostAdvantage()Description copied from interface:IEntityInvokedOperatorController
Gets the cost that was be saved by using the last beneficialOperator
.- Specified by:
getCostAdvantage
in interfaceIEntityInvokedOperatorController
- Returns:
- the cost advantage of using said
Operator
-
getLastBeneficialCostAdvantage
public double getLastBeneficialCostAdvantage()Description copied from interface:IEntityInvokedOperatorController
Gets the amount ofcost
that was saved by using the last beneficialOperator
.- Specified by:
getLastBeneficialCostAdvantage
in interfaceIEntityInvokedOperatorController
- Returns:
- the saved cost
-
copy
Description copied from interface:IEntityInvokedOperatorController
Copies theIEntityInvokedOperatorController
.This is used when copying an
IEntity
since the history of the cost in theOperatorController
is needed.- Specified by:
copy
in interfaceIEntityInvokedOperatorController
- Returns:
- a copy of this Object
-