示例#1
0
 static void CollectVariables(Request.Expr e, Dictionary <string, Variable> vars, GLS.Solver solver)
 {
     if (e.variable != null && !vars.ContainsKey(e.variable))
     {
         vars[e.variable] = solver.MakeNumVar(0.0, double.PositiveInfinity, e.variable);
     }
     if (e.left != null)
     {
         CollectVariables(e.left, vars, solver);
     }
     if (e.right != null)
     {
         CollectVariables(e.right, vars, solver);
     }
 }