package holeg.simple_grid; import holeg.model.GridEdge; import holeg.model.GridNode; import holeg.model.NodeType; import holeg.power_flow.ComplexNumber; import java.io.PrintStream; import java.util.List; public class SimpleGridNode implements GridNode { public List edges; public ComplexNumber powerConsumption = ComplexNumber.Zero; public ComplexNumber powerGeneration = ComplexNumber.Zero; public double voltage; public double phaseDegrees; public double current; public Object tag; public NodeType typeByDesign; public NodeType typeSolved; @Override public NodeType getTypeByDesign() { return typeByDesign; } @Override public NodeType getTypeSolved() { return typeSolved; } @Override public List getEdges() { return edges; } @Override public ComplexNumber getPowerConsumption() { return powerConsumption; } @Override public ComplexNumber getPowerGeneration() { return powerGeneration; } @Override public void setVoltage(double voltage) { this.voltage = voltage; } @Override public void setPhase(double phaseDegrees) { this.phaseDegrees = phaseDegrees; } @Override public void setCurrent(double current) { this.current = current; } @Override public void setTypeSolved(NodeType type) { this.typeSolved = type; } public void print(PrintStream stream) { stream.printf("consumption: %s, generation: %s, voltage: %.3f V, current: %.3f A", powerConsumption.toString(), powerGeneration.toString(), voltage, current); stream.println(); } }