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

com.powsybl.metrix.mapping.log.ZeroDistributionKeyInfo Maven / Gradle / Ivy

There is a newer version: 2.6.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/.
 * SPDX-License-Identifier: MPL-2.0
 */
package com.powsybl.metrix.mapping.log;

import java.util.List;
import java.util.Objects;

/**
 * @author Valentin Berthault {@literal }
 */
public class ZeroDistributionKeyInfo implements LogDescriptionBuilder {

    private final String timeSeriesName;

    private final double timeSeriesValue;

    private final List equipmentIds;

    public ZeroDistributionKeyInfo(String timeSeriesName, double timeSeriesValue,
                                   List equipmentIds) {
        this.timeSeriesName = Objects.requireNonNull(timeSeriesName);
        this.timeSeriesValue = timeSeriesValue;
        this.equipmentIds = Objects.requireNonNull(equipmentIds);
    }

    public LogContent build() {
        LogContent log = new LogContent();
        log.label = "zero distribution key warning";
        log.message = String.format("Distribution key are all equal to zero in scaling down %s of ts %s on equipments %s -> uniform distribution",
                formatDouble(timeSeriesValue), timeSeriesName, equipmentIds);
        return log;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy