package ai.nektron.grownet.debug;

import java.util.Objects;

public final class TraceRunSummary {
    private final long deliveredEvents;
    private final long totalSlots;
    private final long totalSynapses;
    private final int layerCount;
    private final int neuronCount;

    public TraceRunSummary(
            long deliveredEvents,
            long totalSlots,
            long totalSynapses,
            int layerCount,
            int neuronCount) {
        this.deliveredEvents = deliveredEvents;
        this.totalSlots = totalSlots;
        this.totalSynapses = totalSynapses;
        this.layerCount = layerCount;
        this.neuronCount = neuronCount;
    }

    public long getDeliveredEvents() {
        return deliveredEvents;
    }

    public long getTotalSlots() {
        return totalSlots;
    }

    public long getTotalSynapses() {
        return totalSynapses;
    }

    public int getLayerCount() {
        return layerCount;
    }

    public int getNeuronCount() {
        return neuronCount;
    }

    @Override
    public boolean equals(Object otherObject) {
        if (this == otherObject) {
            return true;
        }
        if (!(otherObject instanceof TraceRunSummary otherSummary)) {
            return false;
        }
        return deliveredEvents == otherSummary.deliveredEvents
                && totalSlots == otherSummary.totalSlots
                && totalSynapses == otherSummary.totalSynapses
                && layerCount == otherSummary.layerCount
                && neuronCount == otherSummary.neuronCount;
    }

    @Override
    public int hashCode() {
        return Objects.hash(deliveredEvents, totalSlots, totalSynapses, layerCount, neuronCount);
    }

    @Override
    public String toString() {
        return "TraceRunSummary{"
                + "deliveredEvents=" + deliveredEvents
                + ", totalSlots=" + totalSlots
                + ", totalSynapses=" + totalSynapses
                + ", layerCount=" + layerCount
                + ", neuronCount=" + neuronCount
                + '}';
    }
}
