T
- Type of data modelV
- Type of pricing problemU
- Type of columnsW
- Type of Master Datapublic abstract class AbstractMaster<T extends ModelInterface,U extends AbstractColumn<T,V>,V extends AbstractPricingProblem<T>,W extends MasterData<T,U,V,?>> extends Object implements BranchingDecisionListener
Modifier and Type | Field and Description |
---|---|
protected Configuration |
config
Configuration file for this class
|
protected CutHandler<T,W> |
cutHandler
Handle to a cutHandler which performs separation
|
protected T |
dataModel
Data model
|
protected org.slf4j.Logger |
logger
Logger for this class
|
protected W |
masterData
Data object which stores data from the Master Problem
|
protected OptimizationSense |
optimizationSenseMaster
Defines whether the master problem is a minimization or a maximization problem
|
protected List<V> |
pricingProblems
Pricing Problems
|
Constructor and Description |
---|
AbstractMaster(T dataModel,
List<V> pricingProblems,
CutHandler<T,W> cutHandler,
OptimizationSense optimizationSenseMaster)
Creates a new Master Problem
This implementation will invoke the
buildModel() buildModel} method. |
AbstractMaster(T dataModel,
List<V> pricingProblems,
OptimizationSense optimizationSenseMaster)
Creates a new Master Problem.
|
AbstractMaster(T dataModel,
V pricingProblem,
CutHandler<T,W> cutHandler,
OptimizationSense optimizationSenseMaster)
Creates a new Master Problem
This implementation will invoke the
buildModel() buildModel} method. |
AbstractMaster(T dataModel,
V pricingProblem,
OptimizationSense optimizationSenseMaster)
Creates a new Master Problem
This implementation will invoke the
buildModel() buildModel} method. |
Modifier and Type | Method and Description |
---|---|
abstract void |
addColumn(U column)
Add a column to the model
|
void |
addColumns(List<U> columns)
Add an initial solution (list of columns)
|
void |
addCuts(Collection<AbstractInequality> cuts)
Adds inequalities to this master.
|
void |
branchingDecisionPerformed(BranchingDecision bd)
Method invoked when a branching decision is executed.
|
void |
branchingDecisionReversed(BranchingDecision bd)
Method invoked when a branching decision is reversed due to backtracking in the Branch-and-Price tree.
|
protected abstract W |
buildModel()
Build the master problem
|
abstract void |
close()
Close the master problem
|
void |
exportModel(String name)
Export the master problem to a file e.g.
|
double |
getBoundComponent()
To compute a bound on the optimal solution of the relaxed master problem, multiple components
are required, including information from the master problem.
|
Set<U> |
getColumns(V pricingProblem)
Returns all columns generated for the given pricing problem.
|
List<AbstractInequality> |
getCuts()
Returns all the inequalities in the master model.
|
int |
getIterationCount()
Returns the number of times the master problem has been solved
|
double |
getObjective()
Returns the objective value of the current master problem.
|
OptimizationSense |
getOptimizationSense()
Returns the optimization sense of the Master Problem (minimization or maximization).
|
abstract List<U> |
getSolution()
After the master problem has been solved, a solution has to be returned, consisting of a set of columns selected by the master problem, i.e the columns with a
non-zero value.
|
boolean |
hasNewCuts()
Method which can be invoked externally to check whether the current master problem solution violates any inequalities.
|
abstract void |
initializePricingProblem(V pricingProblem)
Get the reduced cost information required for a particular pricingProblem.
|
boolean |
isOptimal()
Returns true if the master problem has been solved to optimality
|
abstract void |
printSolution()
Give a textual representation of the solution
|
void |
solve(long timeLimit)
Solve the master problem
|
protected abstract boolean |
solveMasterProblem(long timeLimit)
Method implementing the solve procedure for the master problem
|
protected final org.slf4j.Logger logger
protected final Configuration config
protected final T extends ModelInterface dataModel
protected final List<V extends AbstractPricingProblem<T>> pricingProblems
protected W extends MasterData<T,U,V,?> masterData
protected CutHandler<T extends ModelInterface,W extends MasterData<T,U,V,?>> cutHandler
protected final OptimizationSense optimizationSenseMaster
public AbstractMaster(T dataModel, List<V> pricingProblems, OptimizationSense optimizationSenseMaster)
buildModel()
buildModel} method. Any data members required during the execution of buildModel()
buildModel} should be instantiated prior to the invocation of this constructor,
or within the buildModel()
buildModel} method.dataModel
- data modelpricingProblems
- pricing problemsoptimizationSenseMaster
- indicates whether the Master Problem is a Minimiation or a Maximization problempublic AbstractMaster(T dataModel, V pricingProblem, OptimizationSense optimizationSenseMaster)
buildModel()
buildModel} method. Any data members required during the execution of buildModel()
buildModel} should be instantiated prior to the invocation of this constructor,
or within the buildModel()
buildModel} method.dataModel
- data modelpricingProblem
- pricing problemoptimizationSenseMaster
- indicates whether the Master Problem is a Minimiation or a Maximization problempublic AbstractMaster(T dataModel, List<V> pricingProblems, CutHandler<T,W> cutHandler, OptimizationSense optimizationSenseMaster)
buildModel()
buildModel} method. Any data members required during the execution of buildModel()
buildModel} should be instantiated prior to the invocation of this constructor,
or within the buildModel()
buildModel} method.dataModel
- data modelpricingProblems
- pricing problemscutHandler
- Reference to a cut handleroptimizationSenseMaster
- indicates whether the Master Problem is a Minimiation or a Maximization problempublic AbstractMaster(T dataModel, V pricingProblem, CutHandler<T,W> cutHandler, OptimizationSense optimizationSenseMaster)
buildModel()
buildModel} method. Any data members required during the execution of buildModel()
buildModel} should be instantiated prior to the invocation of this constructor,
or within the buildModel()
buildModel} method.dataModel
- data modelpricingProblem
- pricing problemcutHandler
- Reference to a cut handleroptimizationSenseMaster
- indicates whether the Master Problem is a Minimiation or a Maximization problemprotected abstract W buildModel()
public void solve(long timeLimit) throws TimeLimitExceededException
timeLimit
- Future point in time by which this method must be finishedTimeLimitExceededException
- if time limit is exceededprotected abstract boolean solveMasterProblem(long timeLimit) throws TimeLimitExceededException
timeLimit
- Future point in time by which this method must be finishedTimeLimitExceededException
- if time limit is exceededpublic abstract void initializePricingProblem(V pricingProblem)
pricingProblem
- Object in which the dual information required to solve the pricing problems is stored.public OptimizationSense getOptimizationSense()
public double getObjective()
public int getIterationCount()
public boolean isOptimal()
public boolean hasNewCuts()
public void addCuts(Collection<AbstractInequality> cuts)
cuts
- inequalities to be addedpublic List<AbstractInequality> getCuts()
public abstract void addColumn(U column)
column
- column to addpublic void addColumns(List<U> columns)
columns
- initial set of columnspublic Set<U> getColumns(V pricingProblem)
pricingProblem
- Pricing problempublic abstract List<U> getSolution()
public double getBoundComponent()
public void exportModel(String name)
name
- Name of the exported filepublic abstract void printSolution()
public abstract void close()
public void branchingDecisionPerformed(BranchingDecision bd)
branchingDecisionPerformed
in interface BranchingDecisionListener
bd
- branching decisionpublic void branchingDecisionReversed(BranchingDecision bd)
branchingDecisionReversed
in interface BranchingDecisionListener
bd
- branching decisionCopyright © 2016. All rights reserved.