|
@@ -94,7 +94,7 @@ public class HolonSwitch extends AbstractCpsObject implements IGraphedElement {
|
|
|
setLocalPeriod(((IGraphedElement)obj).getLocalPeriod());
|
|
|
setActiveAt(true);
|
|
|
for (int i = 0; i < activeAt.length; i++) {
|
|
|
- activeAt[i] = ((HolonSwitch) obj).getActiveAt(i);
|
|
|
+ activeAt[i] = ((HolonSwitch) obj).getState(i);
|
|
|
}
|
|
|
setGraphPoints(new LinkedList<Point>());
|
|
|
for (Point p : ((HolonSwitch) obj).getGraphPoints()) {
|
|
@@ -130,7 +130,7 @@ public class HolonSwitch extends AbstractCpsObject implements IGraphedElement {
|
|
|
if (manualMode) {
|
|
|
return this.manualActive;
|
|
|
} else {
|
|
|
- return getActiveAt(timeStep);
|
|
|
+ return activeAt[UnitGraph.getEffectiveIndex(this, timeStep)];
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -207,16 +207,6 @@ public class HolonSwitch extends AbstractCpsObject implements IGraphedElement {
|
|
|
public void setGraphPoints(LinkedList<Point> points) {
|
|
|
this.graphPoints = points;
|
|
|
}
|
|
|
-
|
|
|
- /**
|
|
|
- * All values of the graph for the selected Switch (only auto-Mode) get the
|
|
|
- * activeAt Array.
|
|
|
- *
|
|
|
- * @return boolean[] the States of each Iteration
|
|
|
- */
|
|
|
- public boolean/*[]*/ getActiveAt(int i) {
|
|
|
- return activeAt[UnitGraph.getEffectiveIndex(this, i)];
|
|
|
- }
|
|
|
|
|
|
public boolean[] getValueArray() {//TODO: Only used in SubNet line 97. I am not entirely sure how important it is there.
|
|
|
return activeAt;
|
|
@@ -238,7 +228,7 @@ public class HolonSwitch extends AbstractCpsObject implements IGraphedElement {
|
|
|
* the default value
|
|
|
*/
|
|
|
public void setActiveAt(boolean active) {
|
|
|
- //activeAt = new boolean[100];
|
|
|
+ activeAt = new boolean[100];//TODO This is necessary because of thisgson rubbish.
|
|
|
for (int i = 0; i < activeAt.length; i++) {
|
|
|
this.activeAt[i] = active;
|
|
|
}
|