Ejemplo n.º 1
0
 /// <summary>
 /// Add a node that we would like as close to position i as possible, with the requested weight.
 /// </summary>
 /// <param name="id">Caller's unique identifier for this node</param>
 /// <param name="position">Desired position</param>
 /// <param name="weight">The weight of the corresponding term in the goal function</param>
 public void AddVariableWithIdealPosition(int id, double position, double weight)
 {
     // This throws an ArgumentException if a variable with id is already there.
     variables.Add(id, solver.AddVariable(id, position, weight));
 }