Example #1
0
        public ObjectiveFunction111(
            IObjectiveFactory objectiveFactory,
            IsΛ sΛ,
            IΡ Ρ,
            Iω ω,
            Ie1Minus e1Minus,
            Ie1Plus e1Plus)
        {
            Expression expression = Expression.Sum(
                sΛ.Value
                .Select(
                    x => (double)Ρ.GetElementAtAsdecimal(
                        x.ΛIndexElement)
                    *
                    (double)ω.GetElementAtAsdecimal(
                        x.sIndexElement)
                    *
                    (e1Minus.Value[x.sIndexElement, x.ΛIndexElement]
                     +
                     e1Plus.Value[x.sIndexElement, x.ΛIndexElement])
                    *
                    (e1Minus.Value[x.sIndexElement, x.ΛIndexElement]
                     +
                     e1Plus.Value[x.sIndexElement, x.ΛIndexElement])));

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

            this.Value = objective;
        }
Example #2
0
 public Interfaces.Results.TotalExpectedBedShortage.ITEBS Calculate(
     ITEBSFactory TEBSFactory,
     IΛ Λ,
     IΡ Ρ,
     Interfaces.Results.ScenarioTotalExpectedBedShortages.ITEBS TEBS)
 {
     return(TEBSFactory.Create(
                Λ.Value
                .Select(w =>
                        Ρ.GetElementAtAsdecimal(
                            w)
                        *
                        TEBS.GetElementAtAsdecimal(
                            w))
                .ToImmutableList()
                .Sum()));
 }
        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;
        }