TrackedDataSet.java 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. package classes;
  2. import java.awt.Color;
  3. public class TrackedDataSet {
  4. //Property Integers
  5. public static final int CONSUMPTION = 0;
  6. public static final int PRODUCTION = 1;
  7. public static final int ACTIVATED_ELEMENTS = 2;
  8. public static final int ON_OFF = 3;
  9. public static final int TOTAL_PRODUCTION = 4;
  10. public static final int TOTAL_CONSUMPTION = 5;
  11. public static final int PERCENT_SUPPLIED = 6;
  12. public static final int PERCENT_NOT_SUPPLIED = 7;
  13. public static final int PERCENT_PARTIAL_SUPPLIED = 8;
  14. public static final int GRID_PRODUCTION = 9;
  15. public static final int GRID_CONSUMPTION = 10;
  16. //Variables of the Data Set
  17. private AbstractCpsObject cps;
  18. private int property;
  19. private Color color;
  20. //Value for each timeStep
  21. private float values[];
  22. /**
  23. * Data Set for the StatisticGraoh
  24. *
  25. * @param cps
  26. * the cps Object
  27. * @param property
  28. * which value should be tracked
  29. * @param color
  30. * color of the line in the graph
  31. */
  32. public TrackedDataSet(AbstractCpsObject cps, int property, Color color) {
  33. this.cps = cps;
  34. this.property = property;
  35. this.color = color;
  36. this.values = new float[100];
  37. for (int i = 0; i < values.length; i++) {
  38. values[i] = -1;
  39. }
  40. }
  41. public AbstractCpsObject getCpsObject() {
  42. return this.cps;
  43. }
  44. public int getProperty() {
  45. return this.property;
  46. }
  47. public Color getColor() {
  48. return this.color;
  49. }
  50. public float[] getValues() {
  51. return this.values;
  52. }
  53. public void setValAt(float val, int at){
  54. this.values[at] = val;
  55. }
  56. }