DotNet Reference

.Net Reference

Detailed Description

Wrapper class around the cp_model proto.

Definition at line 23 of file CpModel.cs.

Public Member Functions

 CpModel ()
 
IntVar NewIntVar (long lb, long ub, string name)
 
IntVar NewIntVarFromDomain (Domain domain, string name)
 
IntVar NewConstant (long value)
 
IntVar NewConstant (long value, string name)
 
IntVar NewBoolVar (string name)
 
Constraint AddLinearConstraint (LinearExpr linear_expr, long lb, long ub)
 
Constraint AddLinearExpressionInDomain (LinearExpr linear_expr, Domain domain)
 
Constraint Add (BoundedLinearExpression lin)
 
Constraint AddAllDifferent (IEnumerable< IntVar > vars)
 
Constraint AddElement (IntVar index, IEnumerable< IntVar > vars, IntVar target)
 
Constraint AddElement (IntVar index, IEnumerable< long > values, IntVar target)
 
Constraint AddElement (IntVar index, IEnumerable< int > values, IntVar target)
 
Constraint AddCircuit (IEnumerable< Tuple< int, int, ILiteral >> arcs)
 
Constraint AddAllowedAssignments (IEnumerable< IntVar > vars, long[,] tuples)
 
Constraint AddForbiddenAssignments (IEnumerable< IntVar > vars, long[,] tuples)
 
Constraint AddAutomaton (IEnumerable< IntVar > vars, long starting_state, long[,] transitions, IEnumerable< long > final_states)
 
Constraint AddAutomaton (IEnumerable< IntVar > vars, long starting_state, IEnumerable< Tuple< long, long, long >> transitions, IEnumerable< long > final_states)
 
Constraint AddInverse (IEnumerable< IntVar > direct, IEnumerable< IntVar > reverse)
 
Constraint AddReservoirConstraint< I > (IEnumerable< IntVar > times, IEnumerable< I > demands, long min_level, long max_level)
 
Constraint AddReservoirConstraintWithActive< I > (IEnumerable< IntVar > times, IEnumerable< I > demands, IEnumerable< IntVar > actives, long min_level, long max_level)
 
void AddMapDomain (IntVar var, IEnumerable< IntVar > bool_vars, long offset=0)
 
Constraint AddImplication (ILiteral a, ILiteral b)
 
Constraint AddBoolOr (IEnumerable< ILiteral > literals)
 
Constraint AddBoolAnd (IEnumerable< ILiteral > literals)
 
Constraint AddBoolXor (IEnumerable< ILiteral > literals)
 
Constraint AddMinEquality (IntVar target, IEnumerable< IntVar > vars)
 
Constraint AddMaxEquality (IntVar target, IEnumerable< IntVar > vars)
 
Constraint AddDivisionEquality< T, N, D > (T target, N num, D denom)
 
Constraint AddAbsEquality (IntVar target, IntVar var)
 
Constraint AddModuloEquality< T, V, M > (T target, V v, M m)
 
Constraint AddMultiplicationEquality (IntVar target, IEnumerable< IntVar > vars)
 
Constraint AddProdEquality (IntVar target, IEnumerable< IntVar > vars)
 
IntervalVar NewIntervalVar< S, D, E > (S start, D duration, E end, string name)
 
IntervalVar NewOptionalIntervalVar< S, D, E > (S start, D duration, E end, ILiteral is_present, string name)
 
Constraint AddNoOverlap (IEnumerable< IntervalVar > intervals)
 
Constraint AddNoOverlap2D (IEnumerable< IntervalVar > x_intervals, IEnumerable< IntervalVar > y_intervals)
 
Constraint AddCumulative< D, C > (IEnumerable< IntervalVar > intervals, IEnumerable< D > demands, C capacity)
 
void Minimize (LinearExpr obj)
 
void Maximize (LinearExpr obj)
 
void Minimize ()
 
void Maximize ()
 
void AddVarToObjective (IntVar var)
 
void AddTermToObjective (IntVar var, long coeff)
 
void AddDecisionStrategy (IEnumerable< IntVar > vars, DecisionStrategyProto.Types.VariableSelectionStrategy var_str, DecisionStrategyProto.Types.DomainReductionStrategy dom_str)
 
void AddHint (IntVar var, long value)
 
void ClearHints ()
 
void AddAssumption (ILiteral lit)
 
void AddAssumptions (IEnumerable< ILiteral > literals)
 
void ClearAssumptions ()
 
String ModelStats ()
 
Boolean ExportToFile (String filename)
 
String Validate ()
 

Properties

CpModelProto Model [get]
 

Constructor & Destructor Documentation

◆ CpModel()

CpModel ( )
inline

Definition at line 25 of file CpModel.cs.

Member Function Documentation

◆ Add()

Constraint Add ( BoundedLinearExpression  lin)
inline

Definition at line 105 of file CpModel.cs.

◆ AddAbsEquality()

Constraint AddAbsEquality ( IntVar  target,
IntVar  var 
)
inline

Definition at line 455 of file CpModel.cs.

◆ AddAllDifferent()

Constraint AddAllDifferent ( IEnumerable< IntVar vars)
inline

Definition at line 132 of file CpModel.cs.

◆ AddAllowedAssignments()

Constraint AddAllowedAssignments ( IEnumerable< IntVar vars,
long  tuples[,] 
)
inline

Definition at line 200 of file CpModel.cs.

◆ AddAssumption()

void AddAssumption ( ILiteral  lit)
inline

Definition at line 628 of file CpModel.cs.

◆ AddAssumptions()

void AddAssumptions ( IEnumerable< ILiteral literals)
inline

Definition at line 633 of file CpModel.cs.

◆ AddAutomaton() [1/2]

Constraint AddAutomaton ( IEnumerable< IntVar vars,
long  starting_state,
IEnumerable< Tuple< long, long, long >>  transitions,
IEnumerable< long >  final_states 
)
inline

Definition at line 251 of file CpModel.cs.

◆ AddAutomaton() [2/2]

Constraint AddAutomaton ( IEnumerable< IntVar vars,
long  starting_state,
long  transitions[,],
IEnumerable< long >  final_states 
)
inline

Definition at line 226 of file CpModel.cs.

◆ AddBoolAnd()

Constraint AddBoolAnd ( IEnumerable< ILiteral literals)
inline

Definition at line 394 of file CpModel.cs.

◆ AddBoolOr()

Constraint AddBoolOr ( IEnumerable< ILiteral literals)
inline

Definition at line 382 of file CpModel.cs.

◆ AddBoolXor()

Constraint AddBoolXor ( IEnumerable< ILiteral literals)
inline

Definition at line 406 of file CpModel.cs.

◆ AddCircuit()

Constraint AddCircuit ( IEnumerable< Tuple< int, int, ILiteral >>  arcs)
inline

Definition at line 186 of file CpModel.cs.

◆ AddCumulative< D, C >()

Constraint AddCumulative< D, C > ( IEnumerable< IntervalVar intervals,
IEnumerable< D >  demands,
capacity 
)
inline

Definition at line 538 of file CpModel.cs.

◆ AddDecisionStrategy()

void AddDecisionStrategy ( IEnumerable< IntVar vars,
DecisionStrategyProto.Types.VariableSelectionStrategy  var_str,
DecisionStrategyProto.Types.DomainReductionStrategy  dom_str 
)
inline

Definition at line 599 of file CpModel.cs.

◆ AddDivisionEquality< T, N, D >()

Constraint AddDivisionEquality< T, N, D > ( target,
num,
denom 
)
inline

Definition at line 444 of file CpModel.cs.

◆ AddElement() [1/3]

Constraint AddElement ( IntVar  index,
IEnumerable< int >  values,
IntVar  target 
)
inline

Definition at line 172 of file CpModel.cs.

◆ AddElement() [2/3]

Constraint AddElement ( IntVar  index,
IEnumerable< IntVar vars,
IntVar  target 
)
inline

Definition at line 144 of file CpModel.cs.

◆ AddElement() [3/3]

Constraint AddElement ( IntVar  index,
IEnumerable< long >  values,
IntVar  target 
)
inline

Definition at line 158 of file CpModel.cs.

◆ AddForbiddenAssignments()

Constraint AddForbiddenAssignments ( IEnumerable< IntVar vars,
long  tuples[,] 
)
inline

Definition at line 219 of file CpModel.cs.

◆ AddHint()

void AddHint ( IntVar  var,
long  value 
)
inline

Definition at line 613 of file CpModel.cs.

◆ AddImplication()

Constraint AddImplication ( ILiteral  a,
ILiteral  b 
)
inline

Definition at line 372 of file CpModel.cs.

◆ AddInverse()

Constraint AddInverse ( IEnumerable< IntVar direct,
IEnumerable< IntVar reverse 
)
inline

Definition at line 276 of file CpModel.cs.

◆ AddLinearConstraint()

Constraint AddLinearConstraint ( LinearExpr  linear_expr,
long  lb,
long  ub 
)
inline

Definition at line 74 of file CpModel.cs.

◆ AddLinearExpressionInDomain()

Constraint AddLinearExpressionInDomain ( LinearExpr  linear_expr,
Domain  domain 
)
inline

Definition at line 79 of file CpModel.cs.

◆ AddMapDomain()

void AddMapDomain ( IntVar  var,
IEnumerable< IntVar bool_vars,
long  offset = 0 
)
inline

Definition at line 338 of file CpModel.cs.

◆ AddMaxEquality()

Constraint AddMaxEquality ( IntVar  target,
IEnumerable< IntVar vars 
)
inline

Definition at line 431 of file CpModel.cs.

◆ AddMinEquality()

Constraint AddMinEquality ( IntVar  target,
IEnumerable< IntVar vars 
)
inline

Definition at line 418 of file CpModel.cs.

◆ AddModuloEquality< T, V, M >()

Constraint AddModuloEquality< T, V, M > ( target,
v,
m 
)
inline

Definition at line 466 of file CpModel.cs.

◆ AddMultiplicationEquality()

Constraint AddMultiplicationEquality ( IntVar  target,
IEnumerable< IntVar vars 
)
inline

Definition at line 477 of file CpModel.cs.

◆ AddNoOverlap()

Constraint AddNoOverlap ( IEnumerable< IntervalVar intervals)
inline

Definition at line 510 of file CpModel.cs.

◆ AddNoOverlap2D()

Constraint AddNoOverlap2D ( IEnumerable< IntervalVar x_intervals,
IEnumerable< IntervalVar y_intervals 
)
inline

Definition at line 522 of file CpModel.cs.

◆ AddProdEquality()

Constraint AddProdEquality ( IntVar  target,
IEnumerable< IntVar vars 
)
inline

Definition at line 490 of file CpModel.cs.

◆ AddReservoirConstraint< I >()

Constraint AddReservoirConstraint< I > ( IEnumerable< IntVar times,
IEnumerable< I >  demands,
long  min_level,
long  max_level 
)
inline

Definition at line 292 of file CpModel.cs.

◆ AddReservoirConstraintWithActive< I >()

Constraint AddReservoirConstraintWithActive< I > ( IEnumerable< IntVar times,
IEnumerable< I >  demands,
IEnumerable< IntVar actives,
long  min_level,
long  max_level 
)
inline

Definition at line 313 of file CpModel.cs.

◆ AddTermToObjective()

void AddTermToObjective ( IntVar  var,
long  coeff 
)
inline

Definition at line 584 of file CpModel.cs.

◆ AddVarToObjective()

void AddVarToObjective ( IntVar  var)
inline

Definition at line 576 of file CpModel.cs.

◆ ClearAssumptions()

void ClearAssumptions ( )
inline

Definition at line 641 of file CpModel.cs.

◆ ClearHints()

void ClearHints ( )
inline

Definition at line 623 of file CpModel.cs.

◆ ExportToFile()

Boolean ExportToFile ( String  filename)
inline

Definition at line 699 of file CpModel.cs.

◆ Maximize() [1/2]

void Maximize ( )
inline

Definition at line 571 of file CpModel.cs.

◆ Maximize() [2/2]

void Maximize ( LinearExpr  obj)
inline

Definition at line 561 of file CpModel.cs.

◆ Minimize() [1/2]

void Minimize ( )
inline

Definition at line 566 of file CpModel.cs.

◆ Minimize() [2/2]

void Minimize ( LinearExpr  obj)
inline

Definition at line 556 of file CpModel.cs.

◆ ModelStats()

String ModelStats ( )
inline

Definition at line 694 of file CpModel.cs.

◆ NewBoolVar()

IntVar NewBoolVar ( string  name)
inline

Definition at line 69 of file CpModel.cs.

◆ NewConstant() [1/2]

IntVar NewConstant ( long  value)
inline

Definition at line 59 of file CpModel.cs.

◆ NewConstant() [2/2]

IntVar NewConstant ( long  value,
string  name 
)
inline

Definition at line 64 of file CpModel.cs.

◆ NewIntervalVar< S, D, E >()

IntervalVar NewIntervalVar< S, D, E > ( start,
duration,
end,
string  name 
)
inline

Definition at line 497 of file CpModel.cs.

◆ NewIntVar()

IntVar NewIntVar ( long  lb,
long  ub,
string  name 
)
inline

Definition at line 47 of file CpModel.cs.

◆ NewIntVarFromDomain()

IntVar NewIntVarFromDomain ( Domain  domain,
string  name 
)
inline

Definition at line 52 of file CpModel.cs.

◆ NewOptionalIntervalVar< S, D, E >()

IntervalVar NewOptionalIntervalVar< S, D, E > ( start,
duration,
end,
ILiteral  is_present,
string  name 
)
inline

Definition at line 503 of file CpModel.cs.

◆ Validate()

String Validate ( )
inline

Definition at line 704 of file CpModel.cs.

Property Documentation

◆ Model

CpModelProto Model
get

Definition at line 33 of file CpModel.cs.


The documentation for this class was generated from the following file: