Exemple #1
0
        public CVarToVar[] GetConstraintsVars()
        {
            var constraints = new CVarToVar[Network.Variables.Count];

            for (int i = 0; i < Network.Variables.Count; i++)
            {
                constraints[i] = new CVarToVar();
            }
            IEnumerator cs = Network.Constraints.GetEnumerator();

            while (cs.MoveNext())
            {
                var ac = (AllenConstraint)cs.Current;
                if (ac.Vars[0] == this)
                {
                    constraints[ac.Vars[1].Index].ConstraintIndex = ac.AllenEvent;
                    constraints[ac.Vars[1].Index].Var1            = (AllenVariable)ac.Vars[0];
                    constraints[ac.Vars[1].Index].Var2            = (AllenVariable)ac.Vars[1];
                }
            }
            return(constraints);
        }
 public CVarToVar[] GetConstraintsVars()
 {
     var constraints = new CVarToVar[Network.Variables.Count];
     for (int i = 0; i < Network.Variables.Count; i++)
     {
         constraints[i] = new CVarToVar();
     }
     IEnumerator cs = Network.Constraints.GetEnumerator();
     while (cs.MoveNext())
     {
         var ac = (AllenConstraint) cs.Current;
         if (ac.Vars[0] == this)
         {
             constraints[ac.Vars[1].Index].ConstraintIndex = ac.AllenEvent;
             constraints[ac.Vars[1].Index].Var1 = (AllenVariable)ac.Vars[0];
             constraints[ac.Vars[1].Index].Var2 = (AllenVariable)ac.Vars[1];
         }
     }
     return constraints;
 }