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
Constructors -
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.voidsetLastBeneficialJoinedCost(double lastBeneficialJoinedCost) voidsetLastBeneficialJoinedCostAfterInvocation(double lastBeneficialJoinedCostAfterInvocation) voidsetLastInvokedOperator(com.dna.jopt.revision.operator.IOperator op) Sets the last invokedIOperator.voidsetLastJoinedCost(double lastJoinedCost) Sets thecostbefore the newIOperatorwas invoked.
-
Constructor Details
-
EntityInvokedOperatorController
public EntityInvokedOperatorController()
-
-
Method Details
-
getLastInvokedOperator
Description copied from interface:IEntityInvokedOperatorControllerGets the last invokedIOperator.- Specified by:
getLastInvokedOperatorin interfaceIEntityInvokedOperatorController- Returns:
- the Operator
-
getLastBeneficialInvokedOperator
Description copied from interface:IEntityInvokedOperatorControllerGets the lastIOperatorwhich realized acost advantage.If no such
Operatorwas used, returns anempty Optional.- Specified by:
getLastBeneficialInvokedOperatorin interfaceIEntityInvokedOperatorController- Returns:
- the last beneficial
Operator
-
setLastInvokedOperator
public void setLastInvokedOperator(com.dna.jopt.revision.operator.IOperator op) Description copied from interface:IEntityInvokedOperatorControllerSets the last invokedIOperator.- Specified by:
setLastInvokedOperatorin interfaceIEntityInvokedOperatorController- Parameters:
op- the iOperator last used
-
setLastJoinedCost
public void setLastJoinedCost(double lastJoinedCost) Description copied from interface:IEntityInvokedOperatorControllerSets thecostbefore the newIOperatorwas invoked.- Specified by:
setLastJoinedCostin 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:IEntityInvokedOperatorControllerUpdates the last invokedOperatorand the lastjoined costif saidOperatorproved to be beneficial for thecost.- Specified by:
setCostAfterInvocationin interfaceIEntityInvokedOperatorController- Parameters:
costAfterInvocation- the double new cost after theOperator
-
getBenefitCounter
public int getBenefitCounter()Description copied from interface:IEntityInvokedOperatorControllerGets the counter how many times no lowercostshave been achieved by using anIOperator.This counter resets when a beneficial
Operatorhas been invoked andIEntityInvokedOperatorController.setCostAfterInvocation(double)has been called.- Specified by:
getBenefitCounterin interfaceIEntityInvokedOperatorController- Returns:
- the number of times no benefit has been achieved
-
getCostAdvantage
public double getCostAdvantage()Description copied from interface:IEntityInvokedOperatorControllerGets the cost that was be saved by using the last beneficialOperator.- Specified by:
getCostAdvantagein interfaceIEntityInvokedOperatorController- Returns:
- the cost advantage of using said
Operator
-
getLastBeneficialCostAdvantage
public double getLastBeneficialCostAdvantage()Description copied from interface:IEntityInvokedOperatorControllerGets the amount ofcostthat was saved by using the last beneficialOperator.- Specified by:
getLastBeneficialCostAdvantagein interfaceIEntityInvokedOperatorController- Returns:
- the saved cost
-
copy
Description copied from interface:IEntityInvokedOperatorControllerCopies theIEntityInvokedOperatorController.This is used when copying an
IEntitysince the history of the cost in theOperatorControlleris needed.- Specified by:
copyin interfaceIEntityInvokedOperatorController- Returns:
- a copy of this Object
-