|
@@ -1,14 +1,23 @@
|
|
|
package classes;
|
|
|
import ui.model.Model;
|
|
|
+
|
|
|
+import com.google.gson.annotations.Expose;
|
|
|
+
|
|
|
import ui.controller.*;
|
|
|
|
|
|
public class HolonBattery extends AbstractCpsObject{
|
|
|
|
|
|
+ @Expose
|
|
|
private float inRatio;
|
|
|
+ @Expose
|
|
|
private float outRatio;
|
|
|
+ @Expose
|
|
|
private float capacity;
|
|
|
+ @Expose
|
|
|
private float initialStateOfCharge;
|
|
|
+ @Expose
|
|
|
private float[] stateOfChargeLevels;
|
|
|
+ @Expose
|
|
|
private float iterations = 0;
|
|
|
public enum State{STANDBY, COLLECT, EMIT};
|
|
|
private State state;
|
|
@@ -18,9 +27,9 @@ public class HolonBattery extends AbstractCpsObject{
|
|
|
public HolonBattery(String ObjName)
|
|
|
{
|
|
|
super(ObjName);
|
|
|
- inRatio = 0;
|
|
|
- outRatio = 0;
|
|
|
- capacity = 0;
|
|
|
+ inRatio = 1000.0f;
|
|
|
+ outRatio = 1000.0f;
|
|
|
+ capacity = 20000.0f;
|
|
|
initialStateOfCharge = 0;
|
|
|
setState(State.STANDBY);
|
|
|
}
|
|
@@ -38,7 +47,6 @@ public class HolonBattery extends AbstractCpsObject{
|
|
|
setState(State.STANDBY);
|
|
|
}
|
|
|
public float getCapacity() {
|
|
|
-
|
|
|
return capacity;
|
|
|
}
|
|
|
public void setCapacity(float capacity) {
|