All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.powsybl.openrao.searchtreerao.linearoptimisation.inputs.IteratingLinearOptimizerInput Maven / Gradle / Ivy

/*
 * Copyright (c) 2022, RTE (http://www.rte-france.com)
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
package com.powsybl.openrao.searchtreerao.linearoptimisation.inputs;

import com.powsybl.openrao.data.cracapi.Instant;
import com.powsybl.openrao.searchtreerao.commons.ToolProvider;
import com.powsybl.openrao.searchtreerao.commons.objectivefunctionevaluator.ObjectiveFunction;
import com.powsybl.openrao.searchtreerao.commons.optimizationperimeters.OptimizationPerimeter;
import com.powsybl.openrao.searchtreerao.result.api.FlowResult;
import com.powsybl.openrao.searchtreerao.result.api.RangeActionActivationResult;
import com.powsybl.openrao.searchtreerao.result.api.RangeActionSetpointResult;
import com.powsybl.openrao.searchtreerao.result.api.SensitivityResult;
import com.powsybl.openrao.sensitivityanalysis.AppliedRemedialActions;
import com.powsybl.iidm.network.Network;

/**
 * @author Baptiste Seguinot {@literal }
 */
public class IteratingLinearOptimizerInput {

    private final Network network;

    private final OptimizationPerimeter optimizationPerimeter;

    private final FlowResult initialFlowResult;

    private final FlowResult prePerimeterFlowResult;
    private final RangeActionSetpointResult prePerimeterSetpoints;

    private final FlowResult preOptimizationFlowResult;
    private final SensitivityResult preOptimizationSensitivityResult;

    private final AppliedRemedialActions preOptimizationAppliedRemedialActions;
    private final RangeActionActivationResult raActivationFromParentLeaf;

    private final ObjectiveFunction objectiveFunction;

    private final ToolProvider toolProvider;
    private final Instant outageInstant;

    public IteratingLinearOptimizerInput(Network network,
                                         OptimizationPerimeter optimizationPerimeter,
                                         FlowResult initialFlowResult,
                                         FlowResult prePerimeterFlowResult,
                                         RangeActionSetpointResult prePerimeterSetpoints,
                                         FlowResult preOptimizationFlowResult,
                                         SensitivityResult preOptimizationSensitivityResult,
                                         AppliedRemedialActions preOptimizationAppliedRemedialActions,
                                         RangeActionActivationResult raActivationFromParentLeaf,
                                         ObjectiveFunction objectiveFunction,
                                         ToolProvider toolProvider,
                                         Instant outageInstant) {
        this.network = network;
        this.optimizationPerimeter = optimizationPerimeter;
        this.initialFlowResult = initialFlowResult;
        this.prePerimeterFlowResult = prePerimeterFlowResult;
        this.prePerimeterSetpoints = prePerimeterSetpoints;
        this.preOptimizationFlowResult = preOptimizationFlowResult;
        this.preOptimizationSensitivityResult = preOptimizationSensitivityResult;
        this.preOptimizationAppliedRemedialActions = preOptimizationAppliedRemedialActions;
        this.raActivationFromParentLeaf = raActivationFromParentLeaf;
        this.objectiveFunction = objectiveFunction;
        this.toolProvider = toolProvider;
        this.outageInstant = outageInstant;
    }

    public Network getNetwork() {
        return network;
    }

    public OptimizationPerimeter getOptimizationPerimeter() {
        return optimizationPerimeter;
    }

    public FlowResult getInitialFlowResult() {
        return initialFlowResult;
    }

    public FlowResult getPrePerimeterFlowResult() {
        return prePerimeterFlowResult;
    }

    public RangeActionSetpointResult getPrePerimeterSetpoints() {
        return prePerimeterSetpoints;
    }

    public FlowResult getPreOptimizationFlowResult() {
        return preOptimizationFlowResult;
    }

    public SensitivityResult getPreOptimizationSensitivityResult() {
        return preOptimizationSensitivityResult;
    }

    public AppliedRemedialActions getPreOptimizationAppliedRemedialActions() {
        return preOptimizationAppliedRemedialActions;
    }

    public RangeActionActivationResult getRaActivationFromParentLeaf() {
        return raActivationFromParentLeaf;
    }

    public ObjectiveFunction getObjectiveFunction() {
        return objectiveFunction;
    }

    public ToolProvider getToolProvider() {
        return toolProvider;
    }

    public Instant getOutageInstant() {
        return outageInstant;
    }

    public static IteratingLinearOptimizerInputBuilder create() {
        return new IteratingLinearOptimizerInputBuilder();
    }

    public static class IteratingLinearOptimizerInputBuilder {
        private Network network;
        private OptimizationPerimeter optimizationPerimeter;
        private FlowResult initialFlowResult;
        private FlowResult prePerimeterFlowResult;
        private RangeActionSetpointResult prePerimeterSetpoints;
        private FlowResult preOptimizationFlowResult;
        private SensitivityResult preOptimizationSensitivityResult;
        private AppliedRemedialActions preOptimizationAppliedRemedialActions;
        private RangeActionActivationResult raActivationFromParentLeaf;
        private ObjectiveFunction objectiveFunction;
        private ToolProvider toolProvider;
        private Instant outageInstant;

        public IteratingLinearOptimizerInputBuilder withNetwork(Network network) {
            this.network = network;
            return this;
        }

        public IteratingLinearOptimizerInputBuilder withOptimizationPerimeter(OptimizationPerimeter optimizationPerimeter) {
            this.optimizationPerimeter = optimizationPerimeter;
            return this;
        }

        public IteratingLinearOptimizerInputBuilder withInitialFlowResult(FlowResult initialFlowResult) {
            this.initialFlowResult = initialFlowResult;
            return this;
        }

        public IteratingLinearOptimizerInputBuilder withPrePerimeterFlowResult(FlowResult prePerimeterFlowResult) {
            this.prePerimeterFlowResult = prePerimeterFlowResult;
            return this;
        }

        public IteratingLinearOptimizerInputBuilder withPrePerimeterSetpoints(RangeActionSetpointResult prePerimeterSetpoints) {
            this.prePerimeterSetpoints = prePerimeterSetpoints;
            return this;
        }

        public IteratingLinearOptimizerInputBuilder withPreOptimizationFlowResult(FlowResult preOptimizationFlowResult) {
            this.preOptimizationFlowResult = preOptimizationFlowResult;
            return this;
        }

        public IteratingLinearOptimizerInputBuilder withPreOptimizationSensitivityResult(SensitivityResult preOptimizationSensitivityResult) {
            this.preOptimizationSensitivityResult = preOptimizationSensitivityResult;
            return this;
        }

        public IteratingLinearOptimizerInputBuilder withPreOptimizationAppliedRemedialActions(AppliedRemedialActions preOptimizationAppliedRemedialActions) {
            this.preOptimizationAppliedRemedialActions = preOptimizationAppliedRemedialActions;
            return this;
        }

        public IteratingLinearOptimizerInputBuilder withRaActivationFromParentLeaf(RangeActionActivationResult raActivationFromParentLeaf) {
            this.raActivationFromParentLeaf = raActivationFromParentLeaf;
            return this;
        }

        public IteratingLinearOptimizerInputBuilder withObjectiveFunction(ObjectiveFunction objectiveFunction) {
            this.objectiveFunction = objectiveFunction;
            return this;
        }

        public IteratingLinearOptimizerInputBuilder withToolProvider(ToolProvider toolProvider) {
            this.toolProvider = toolProvider;
            return this;
        }

        public IteratingLinearOptimizerInputBuilder withOutageInstant(Instant outageInstant) {
            this.outageInstant = outageInstant;
            return this;
        }

        public IteratingLinearOptimizerInput build() {
            return new IteratingLinearOptimizerInput(network,
                optimizationPerimeter,
                initialFlowResult,
                prePerimeterFlowResult,
                prePerimeterSetpoints,
                preOptimizationFlowResult,
                preOptimizationSensitivityResult,
                preOptimizationAppliedRemedialActions,
                raActivationFromParentLeaf,
                objectiveFunction,
                toolProvider,
                outageInstant);
        }
    }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy