HolonObject.java 771 B

123456789101112131415161718192021222324252627282930
  1. package ui.controller;
  2. public class HolonObject extends CpsObject {
  3. /*Array of all consumers*/
  4. HolonElement[] consumers;
  5. /*Array of all producers*/
  6. HolonElement[] producers;
  7. /*Total of consumption*/
  8. float currentEnergy;
  9. /**
  10. * State of the building:
  11. * 0 = fully supplied (currentEnergy == 0)
  12. * 1 = not enough energy (currentEnergy > 0)
  13. * 2 = oversupplied (currentEnergy < 0)
  14. */
  15. int state;
  16. /**
  17. * Constructor
  18. * Set by default the name of the object equals to the category name, until the user changes it.
  19. */
  20. public HolonObject() {
  21. super.setObjName("House");
  22. super.name = super.getObjName();
  23. System.out.println("You create a " + super.objName + " with ID " + super.ID);
  24. System.out.println("It's actual name is: " + super.name);
  25. }
  26. }