BoundControl

Controls for functions related to bound

IsUsePrimalBound

public override bool IsUsePrimalBound()

Definition

Sets whether the logic to get the primal bound from state is applied.

Return

Example (Default Logic)

public override bool IsUsePrimalBound()
{
    return true;
}

IsUseDualBound

public override bool IsUseDualBound()

Definition

Sets whether the logic to get the dual bound from state is applied.

Return

Example (Default Logic)

public override bool IsUseDualBound()
{
    return true;
}

GetPruneTolerance

public override double GetPruneTolerance()

Definition

The tolerance used to determine whether the state can be pruned without loss of optimality.

Return

Example (Default Logic)

public override double GetPruneTolerance()
{
    return Math.Pow(10, -4);
}

GetPrimalBoundStopStageIndex

public override int GetPrimalBoundStopStageIndex()

Definition

Sets the index of the stage that stops applying the logic to obtain the primal bound. (i.e., the primal bound is not obtained from that stage.)

Return

Example (Default Logic)

public override int GetPrimalBoundStopStageIndex()
{
    return Int32.MaxValue;
}

GetPrimalBoundStopRelativeGap

public override double GetPrimalBoundStopRelativeGap()

Definition

Sets a relative duality gap at which to stop applying the logic to find the primal bound. (i.e., primal bound will not be found when the relative duality gap is satisfied.)

Relative duality gap = |Best dual bound - Best primal bound| / Best dual bound

Return

Example (Default Logic)

public override double GetPrimalBoundStopRelativeGap() 
{
    return 0;
}

GetDualBoundStopStageIndex

public override int GetDualBoundStopStageIndex()

Definition

Sets the index of the stage that stops applying the logic to obtain the dual bound. (i.e., dual bound is not obtained from that stage.)

Return

Example (Default Logic)

public override int GetPrimalBoundStopStageIndex()
{
    return Int32.MaxValue;
}

GetDualBoundStopRelativeGap

public override double GetDualBoundStopRelativeGap()

Definition

Sets a relative duality gap at which to stop applying the logic to find the dual bound. (i.e., dual bound will not be found when the relative duality gap is satisfied.)

Return

Example (Default Logic)

public override double GetDualBoundStopRelativeGap()
{
    return 0;
}

GetInitialPrimalBound

 public override double GetInitialPrimalBound(ObjectiveFunctionType objectiveFunctionType)

Definition

Returns the initial primal bound value.

Parameters

Return

Example (Default Logic)

public override double GetInitialPrimalBound(ObjectiveFunctionType objectiveFunctionType)
{
    double primalBound = 0;

    if (objectiveFunctionType == ObjectiveFunctionType.Maximize)
    {
        primalBound = Double.NegativeInfinity;
    }
    else if (objectiveFunctionType == ObjectiveFunctionType.Minimize)
    {
        primalBound = Double.PositiveInfinity;
    }

    return primalBound;
}

GetInitialDualBound

public override double GetInitialDualBound(ObjectiveFunctionType objectiveFunctionType)

Definition

Returns the initial dual bound value.

Parameters

Return

Example (Default Logic)

public virtual double GetInitialDualBound(ObjectiveFunctionType objectiveFunctionType)
{
    double dualBound = 0;

    if (objectiveFunctionType == ObjectiveFunctionType.Maximize)
    {
        dualBound = Double.PositiveInfinity;
    }
    else if (objectiveFunctionType == ObjectiveFunctionType.Minimize)
    {
        dualBound = Double.NegativeInfinity;
    }

    return dualBound;
}

UseAbsoluteOptimalityGap

public virtual bool UseAbsoluteOptimalityGap()

Definition

Whether to terminate the search based on the absolute duality gap (the absolute difference between the primal bound and dual bound), i.e., terminate the search if the absolute duality gap is below the set value.

Absolute duality gap = |Best dual bound - Best primal bound|

Return

If the return value is False, the relative duality gap is applied as a condition for terminating the search. (See the corresponding control)

Example (Default Logic)

public virtual bool UseAbsoluteOptimalityGap()
{
    return false;
}

GetRelativeOptimalityGap

public virtual double GetRelativeOptimalityGap()

Definition

Sets the relative duality gap at which to stop exploration, i.e., if the relative duality gap value is below the set value, the exploration is terminated.

Relative Duality Gap = |Best Dual Bound - Best Primal Bound| / Best Dual Bound

Return

Example (Default Logic)

public virtual double GetRelativeOptimalityGap()
{
    return 0;
}

GetAbsoluteOptimalityGap

public virtual double GetAbsoluteOptimalityGap()

Definition

Sets the absolute duality gap at which to stop exploration, i.e., if the absolute duality gap value is below the set value, the exploration is terminated.

Return

Example (Default Logic)

public virtual double GetAbsoluteOptimalityGap()
{
    return 0;
}

GetDualBound

public virtual double GetDualBound(State state)

Definition

Returns the dual bound of the given state.

Parameters

Return

Example

public override double GetDualBound(State state)
{
    double bound = 0;
    CRPState crpState = state as CRPState;

    bound = crpState.GetTotalColorCount() - 1;

    return bound;
}

GetPrimalBound

public override double GetPrimalBound(Solution solution)

Definition

Returns the primal bound corresponding to the given feasible solution.

Parameters

Return

Example (Default Logic)

public override double GetPrimalBound(Solution solution)
{
    return solution.Value;
}

GetPrimalSolutionUpdatePeriod

public override int GetPrimalSolutionUpdatePeriod()

Definition

Returns the state count interval to apply the logic to find the primal solution in the state. For example, if you set the interval to 1000, the logic will be applied to find the primal solution once every 1000 states.

Return

Example (Default Logic)

public override int GetPrimalSolutionUpdatePeriod()
{
    return 1000;
}

GetDualBoundUpdatePeriod

public override int GetDualBoundUpdatePeriod()

Definition

Returns the state count interval to apply the logic to find the dual bound in the state. For example, if you set the interval to 1000, the logic will be applied to calculate the dual bound once every 1000 states.

Return

Example (Default Logic)

public virtual int GetDualBoundUpdatePeriod()
{
    return 1;
}

Last updated