示例#1
0
        public IObjectiveFunction Create(
            IObjectiveFactory objectiveFactory,
            It t,
            IΛ Λ,
            IΡ Ρ,
            IIHat IHat)
        {
            IObjectiveFunction objectiveFunction = null;

            try
            {
                objectiveFunction = new ObjectiveFunction(
                    objectiveFactory,
                    t,
                    Λ,
                    Ρ,
                    IHat);
            }
            catch (Exception exception)
            {
                this.Log.Error("Exception message: " + exception.Message + " and stacktrace " + exception.StackTrace);
            }

            return(objectiveFunction);
        }
示例#2
0
        public IConstraints4ConstraintElement Create(
            ItIndexElement tIndexElement,
            IΛIndexElement ΛIndexElement,
            Il l,
            It t,
            Ist st,
            IΦHat ΦVHat,
            IIHat IHat,
            Iz z)
        {
            IConstraints4ConstraintElement constraintElement = null;

            try
            {
                constraintElement = new Constraints4ConstraintElement(
                    tIndexElement,
                    ΛIndexElement,
                    l,
                    t,
                    st,
                    ΦVHat,
                    IHat,
                    z);
            }
            catch (Exception exception)
            {
                this.Log.Error("Exception message: " + exception.Message + " and stacktrace " + exception.StackTrace);
            }

            return(constraintElement);
        }
示例#3
0
        public Constraints6ConstraintElement(
            ItIndexElement tIndexElement,
            IΛIndexElement ΛIndexElement,
            Il l,
            It t,
            Ist st,
            IΦHat ΦVHat,
            IIHat IHat,
            Iz z)
        {
            Expression LHS = IHat.Value[tIndexElement, ΛIndexElement];

            Expression RHS = Expression.Sum(
                st.Value
                .Select(
                    y =>
                    (double)ΦVHat.GetElementAtAsdecimal(
                        y.sIndexElement,
                        l.GetElementAt(
                            tIndexElement.Key
                            -
                            y.tIndexElement.Key
                            +
                            (int)Math.Floor(
                                (decimal)(y.tIndexElement.Key)
                                /
                                (tIndexElement.Key + 1))
                            *
                            t.GetT()),
                        ΛIndexElement)
                    *
                    z.Value[y.sIndexElement, y.tIndexElement]));

            this.Value = LHS == RHS;
        }
示例#4
0
        public IIHat Create(
            VariableCollection <ItIndexElement, IΛIndexElement> value)
        {
            IIHat variable = null;

            try
            {
                variable = new IHat(
                    value);
            }
            catch (Exception exception)
            {
                this.Log.Error("Exception message: " + exception.Message + " and stacktrace " + exception.StackTrace);
            }

            return(variable);
        }
示例#5
0
        public IIHat Create(
            ImmutableList <IIHatResultElement> value)
        {
            IIHat result = null;

            try
            {
                result = new IHat(
                    value);
            }
            catch (Exception exception)
            {
                this.Log.Error("Exception message: " + exception.Message + " and stacktrace " + exception.StackTrace);
            }

            return(result);
        }
示例#6
0
        public IIHat Create(
            ImmutableList <IIHatResultElement> value)
        {
            IIHat result = null;

            try
            {
                result = new IHat(
                    value);
            }
            catch (Exception exception)
            {
                this.Log.Error(
                    exception.Message,
                    exception);
            }

            return(result);
        }
示例#7
0
        public IIHat Create(
            VariableCollection <ItIndexElement, IΛIndexElement> value)
        {
            IIHat variable = null;

            try
            {
                variable = new IHat(
                    value);
            }
            catch (Exception exception)
            {
                this.Log.Error(
                    exception.Message,
                    exception);
            }

            return(variable);
        }
        public ObjectiveFunction(
            IObjectiveFactory objectiveFactory,
            It t,
            IΛ Λ,
            IΡ Ρ,
            IIHat IHat)
        {
            Expression expression = Expression.Sum(
                Λ.Value
                .Select(
                    x => (double)Ρ.GetElementAtAsdecimal(
                        x)
                    *
                    Expression.Maximum(
                        t.Value
                        .Select(y => (Expression)IHat.Value[y, x]))));

            Objective objective = objectiveFactory.Create(
                expression,
                ObjectiveSense.Minimize);

            this.Value = objective;
        }