TrackedDataSet.java 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 GROUP_PRODUCTION = 9;
  15. public static final int GROUP_CONSUMPTION = 10;
  16. public static final int AMOUNT_HOLONS = 11;
  17. public static final int AVG_AMOUNT_CLOSED_SWITCHES_IN_HOLONS = 12;
  18. public static final int AVG_AMOUNT_OPEN_SWITCHES_IN_HOLONS = 13;
  19. public static final int AVG_AMOUNT_OBJECTS_IN_HOLONS = 14;
  20. public static final int AVG_AMOUNT_ELEMENTS_IN_HOLONS = 15;
  21. public static final int AVG_AMOUNT_PRODUCERS_IN_HOLONS = 16;
  22. public static final int CONSUMED_ENERGY_IN_HOLONS = 17;
  23. public static final int WASTED_ENERGY_IN_HOLONS = 18;
  24. public static final int AVG_AMOUNT_BROKEN_EDGES_IN_HOLONS = 19;
  25. public static final int RATIO_PRODUCERS_CONSUMERS = 21;
  26. //Variables of the Data Set
  27. private AbstractCpsObject cps;
  28. private int property;
  29. private Color color;
  30. //Value for each timeStep
  31. private float values[];
  32. /**
  33. * Data Set for the StatisticGraoh
  34. *
  35. * @param cps
  36. * the cps Object
  37. * @param property
  38. * which value should be tracked
  39. * @param color
  40. * color of the line in the graph
  41. */
  42. public TrackedDataSet(AbstractCpsObject cps, int property, Color color) {
  43. this.cps = cps;
  44. this.property = property;
  45. this.color = color;
  46. this.values = new float[100];
  47. for (int i = 0; i < values.length; i++) {
  48. values[i] = -1;
  49. }
  50. }
  51. public AbstractCpsObject getCpsObject() {
  52. return this.cps;
  53. }
  54. public int getProperty() {
  55. return this.property;
  56. }
  57. public Color getColor() {
  58. return this.color;
  59. }
  60. public float[] getValues() {
  61. return this.values;
  62. }
  63. public void setValAt(float val, int at){
  64. this.values[at] = val;
  65. }
  66. }