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

com.farao_community.farao.data.crac_impl.BranchThresholdImpl Maven / Gradle / Ivy

There is a newer version: 5.0.0
Show 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.farao_community.farao.data.crac_impl;

import com.farao_community.farao.commons.Unit;
import com.farao_community.farao.data.crac_api.cnec.Side;
import com.farao_community.farao.data.crac_api.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 Side side;

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

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

    @Override
    public Side 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