15using System.Collections.Generic;
39 terms_ =
new Queue<Term>();
51 constant += coefficient * a.
Offset;
54 foreach (
Term sub
in a.Terms)
61 foreach (
Term sub
in a.Terms)
70 constant += coefficient * value;
73 throw new ArgumentException(
"Cannot evaluate a literal in an integer expression.");
75 throw new ArgumentException(
"Cannot evaluate '" + expr +
"' in an integer expression");
78 if (!terms_.TryDequeue(out var term))
83 coefficient = term.coefficient;
113 throw new ArgumentException(
"Cannot evaluate '" + literal.ToString() +
"' as a boolean literal");
117 private Queue<Term> terms_;
127 private DateTime _startTime;
128 private int _solutionCount;
132 _startTime = DateTime.Now;
137 var currentTime = DateTime.Now;
140 var objLb = Math.Min(objective, objectiveBound);
141 var objUb = Math.Max(objective, objectiveBound);
142 var time = currentTime - _startTime;
145 value: $
"Solution {_solutionCount}, time = {time.TotalSeconds} s, objective = [{objLb}, {objUb}]");