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

com.farao_community.farao.loopflow_computation.LoopFlowComputationWithXnodeGlskHandler Maven / Gradle / Ivy

There is a newer version: 5.0.0
Show newest version
/*
 * Copyright (c) 2021, 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.farao_community.farao.loopflow_computation;

import com.farao_community.farao.commons.EICode;
import com.powsybl.glsk.commons.ZonalData;
import com.farao_community.farao.data.crac_api.Contingency;
import com.farao_community.farao.data.crac_api.cnec.FlowCnec;
import com.farao_community.farao.data.refprog.reference_program.ReferenceProgram;
import com.powsybl.iidm.network.Network;
import com.powsybl.sensitivity.SensitivityVariableSet;
import java.util.Map;
import java.util.Set;
import java.util.stream.Stream;

/**
 * @author Joris Mancini {@literal }
 */
public class LoopFlowComputationWithXnodeGlskHandler extends LoopFlowComputationImpl {

    private final XnodeGlskHandler xnodeGlskHandler;

    public LoopFlowComputationWithXnodeGlskHandler(ZonalData glsk, ReferenceProgram referenceProgram, Set contingencies, Network network) {
        super(glsk, referenceProgram);
        xnodeGlskHandler = new XnodeGlskHandler(glsk, contingencies, network);
    }

    LoopFlowComputationWithXnodeGlskHandler(ZonalData glsk, ReferenceProgram referenceProgram, XnodeGlskHandler xnodeGlskHandler) {
        super(glsk, referenceProgram);
        this.xnodeGlskHandler = xnodeGlskHandler;
    }

    @Override
    protected Stream> getGlskStream(FlowCnec flowCnec) {
        return super.getGlskStream(flowCnec)
                .filter(entry -> xnodeGlskHandler.isLinearGlskValidForCnec(flowCnec, entry.getValue()));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy