示例#1
0
 public void TransponateIfNeeded(OptimisingType type)
 {
     if (type == OptimisingType.min)
     {
         Transpose();
     }
 }
示例#2
0
 public void SetObjectiveFunction(string objectiveFunction)
 {
     if (objectiveFunction.Contains("min"))
     {
         TargetType = OptimisingType.min;
     }
     else if (objectiveFunction.Contains("max"))
     {
         TargetType = OptimisingType.max;
     }
     else
     {
         throw new UnkonwTargetType(objectiveFunction);
     }
     _ObjectiveFunction = RemoveUnessearryStringGarbage(objectiveFunction);
 }
示例#3
0
        public SimplexLineCollection(NewObjectiveFunction newObjectiveFunction, List <NewConstrain> newConstrains, OptimisingType type)
        {
            constrains        = newConstrains;
            objectiveFunction = newObjectiveFunction;
            TransponateIfNeeded(type);
            foreach (var item in constrains)
            {
                item.NumberOfConstrains = (constrains.Count);
            }
            int i = 0;

            foreach (var item in constrains)
            {
                item.GenerateSlackVariable(i);
                i++;
            }
            objectiveFunction.GenerateSlackVariable();
        }