コード例 #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;
        }
コード例 #2
0
        public async Task <Guid> Handle(AddObjectiveCommand request, CancellationToken cancellationToken)
        {
            var objective = _objectiveFactory.Create(request.Name, request.Description);

            await _objectiveRepository.Create(objective);

            await _unitOfWork.Commit();

            return(objective.Id);
        }
コード例 #3
0
        public ObjectiveFunction010(
            IObjectiveFactory objectiveFactory,
            Ijr jr,
            Iw w)
        {
            Expression expression = Expression.Sum(
                jr.Value
                .Select(
                    x => w.Value[x.jIndexElement, x.rIndexElement]));

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

            this.Value = objective;
        }
コード例 #4
0
        public ObjectiveFunction001(
            IObjectiveFactory objectiveFactory,
            Isr sr,
            Iy y)
        {
            Expression expression = Expression.Sum(
                sr.Value
                .Select(
                    x => y.Value[x.sIndexElement, x.rIndexElement]));

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

            this.Value = objective;
        }
コード例 #5
0
        public ObjectiveFunction(
            IObjectiveFactory objectiveFactory,
            Isd sd,
            Iu u)
        {
            Expression expression = Expression.Sum(
                sd.Value
                .Select(
                    x => u.Value[x.sIndexElement, x.dIndexElement]));

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

            this.Value = objective;
        }
コード例 #6
0
        public ObjectiveFunction100(
            IObjectiveFactory objectiveFactory,
            Imr mr,
            IC C,
            Iv v)
        {
            Expression expression = Expression.Sum(
                mr.Value
                .Select(
                    x => (double)C.GetElementAtAsdecimal(
                        x.mIndexElement)
                    *
                    v.Value[x.mIndexElement, x.rIndexElement]));

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

            this.Value = objective;
        }
コード例 #7
0
        public SPObjectiveFunction(
            IObjectiveFactory objectiveFactory,
            Ipa pa,
            Ir r,
            ISPx x)
        {
            Expression expression = Expression.Sum(
                pa.Value
                .Select(
                    i =>
                    (double)r.GetElementAtAsdecimal(
                        i.pIndexElement)
                    *
                    x.Value[i.pIndexElement, i.aIndexElement]));

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

            this.Value = objective;
        }
コード例 #8
0
        public TPObjectiveFunction(
            IObjectiveFactory objectiveFactory,
            Id d,
            Iw w,
            Iα α,
            Iβ β,
            Iγ γ,
            IδMinus δMinus,
            Interfaces.Variables.TP.WardSpareBeds.IδPlus δPlus_w,
            Interfaces.Variables.TP.WardBedOccupancyVariances.IVariance Variance_w)
        {
            Expression expression = Expression.Sum(
                w.Value
                .Select(
                    i =>
                    (double)α.GetElementAtAsdecimal(
                        i)
                    *
                    Expression.Sum(
                        d.Value
                        .Select(
                            j =>
                            δMinus.Value[i, j]))
                    +
                    (double)β.GetElementAtAsdecimal(
                        i)
                    *
                    δPlus_w.Value[i]
                    +
                    (double)γ.GetElementAtAsdecimal(
                        i)
                    *
                    Variance_w.Value[i]));

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

            this.Value = objective;
        }
コード例 #9
0
        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;
        }