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

com.powsybl.openrao.data.cracimpl.BranchThresholdImpl Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (c) 2019, 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.data.cracimpl;

import com.powsybl.openrao.commons.Unit;
import com.powsybl.iidm.network.TwoSides;
import com.powsybl.openrao.data.cracapi.threshold.BranchThreshold;

/**
 * Limits of a flow (in MEGAWATT or AMPERE) through a branch.
 *
 * @author Joris Mancini {@literal }
 * @author Baptiste Seguinot {@literal }
 * @author Viktor Terrier {@literal }
 */
public class BranchThresholdImpl extends ThresholdImpl implements BranchThreshold {

    /**
     * Side of the network element which is monitored
     */
    protected TwoSides side;

    /**
     * Direction in which the flow is monitored
     */

    BranchThresholdImpl(TwoSides side, Unit unit, Double min, Double max) {
        super(unit, min, max);
        this.side = side;
    }

    @Override
    public TwoSides getSide() {
        return side;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        BranchThresholdImpl otherT = (BranchThresholdImpl) o;

        return super.equals(otherT)
                && side.equals(otherT.getSide());
    }

    @Override
    public int hashCode() {
        return super.hashCode()
                + 31 * side.hashCode();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy