TrackedDataSet.java 1.6 KB

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