1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- package classes;
- import java.awt.Color;
- import com.google.gson.annotations.Expose;
- public class TrackedDataSet {
- //Property Integers
- public static final int CONSUMPTION = 0;
- public static final int PRODUCTION = 1;
- public static final int ACTIVATED_ELEMENTS = 2;
- public static final int ON_OFF = 3;
- public static final int TOTAL_PRODUCTION = 4;
- public static final int TOTAL_CONSUMPTION = 5;
- public static final int PERCENT_SUPPLIED = 6;
- public static final int PERCENT_NOT_SUPPLIED = 7;
- public static final int PERCENT_PARTIAL_SUPPLIED = 8;
- public static final int GROUP_PRODUCTION = 9;
- public static final int GROUP_CONSUMPTION = 10;
- public static final int AMOUNT_HOLONS = 11;
- public static final int AMOUNT_CLOSED_SWITCHES = 12;
- public static final int AVG_AMOUNT_OBJECTS_IN_HOLONS = 13;
- public static final int AVG_AMOUNT_ELEMENTS_IN_HOLONS = 14;
- public static final int AVG_AMOUNT_PRODUCERS_IN_HOLONS = 15;
- public static final int AVG_CONSUMED_ENERGY_IN_HOLONS = 16;
- public static final int AVG_WASTED_ENERGY_IN_HOLONS = 17;
- public static final int AMOUNT_BROKEN_EDGES = 18;
- public static final int RATIO_PRODUCERS_CONSUMERS = 19;
- public static final int AVG_AMOUNT_CLOSED_SWITCHES_IN_HOLONS = 20;
- public static final int AVG_AMOUNT_ACTIVE_ELEMENTS_IN_HOLONS = 21;
- public static final int AVG_AMOUNT_INACTIVE_ELEMENTS_IN_HOLONS = 22;
- public static final int AVG_PRODUCED_ENERGY_IN_HOLONS = 23;
-
- //Variables of the Data Set
- private AbstractCpsObject cps;
- @Expose
- private int property;
- @Expose
- private Color color;
- //Value for each timeStep
-
- private float values[];
-
- /**
- * Data Set for the StatisticGraoh
- *
- * @param cps
- * the cps Object
- * @param property
- * which value should be tracked
- * @param color
- * color of the line in the graph
- */
- public TrackedDataSet(AbstractCpsObject cps, int property, Color color) {
- this.cps = cps;
- this.property = property;
- this.color = color;
- this.values = new float[100];
- resetValues();
- }
- public AbstractCpsObject getCpsObject() {
- return this.cps;
- }
- public int getProperty() {
- return this.property;
- }
- public Color getColor() {
- return this.color;
- }
-
- public float[] getValues() {
- return this.values;
- }
-
- public void setValAt(float val, int at){
- this.values[at] = val;
- }
-
- /**
- * Resets all values.
- */
- public void resetValues(){
- for (int i = 0; i < values.length; i++) {
- values[i] = -1;
- }
- }
- }
|