TrackedDataSet.java 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. //Variables of the Data Set
  15. private AbstractCpsObject cps;
  16. private int property;
  17. private Color color;
  18. //Value for each timeStep
  19. private float values[];
  20. /**
  21. * Data Set for the StatisticGraoh
  22. *
  23. * @param cps
  24. * the cps Object
  25. * @param property
  26. * which value should be tracked
  27. * @param color
  28. * color of the line in the graph
  29. */
  30. public TrackedDataSet(AbstractCpsObject cps, int property, Color color) {
  31. this.cps = cps;
  32. this.property = property;
  33. this.color = color;
  34. this.values = new float[100];
  35. for (int i = 0; i < values.length; i++) {
  36. values[i] = -1;
  37. }
  38. }
  39. public AbstractCpsObject getCpsObject() {
  40. return this.cps;
  41. }
  42. public int getProperty() {
  43. return this.property;
  44. }
  45. public Color getColor() {
  46. return this.color;
  47. }
  48. public float[] getValues() {
  49. return this.values;
  50. }
  51. public void setValAt(float val, int at){
  52. this.values[at] = val;
  53. }
  54. }