|
@@ -56,6 +56,8 @@ public class CpsEdge {
|
|
* Source
|
|
* Source
|
|
* @param b
|
|
* @param b
|
|
* Destination
|
|
* Destination
|
|
|
|
+ * @param maxCap
|
|
|
|
+ * Maximum Capacity
|
|
*/
|
|
*/
|
|
public CpsEdge(AbstractCpsObject a, AbstractCpsObject b, float maxCap) {
|
|
public CpsEdge(AbstractCpsObject a, AbstractCpsObject b, float maxCap) {
|
|
setA(a);
|
|
setA(a);
|
|
@@ -105,7 +107,7 @@ public class CpsEdge {
|
|
this.flow = flow;
|
|
this.flow = flow;
|
|
/**
|
|
/**
|
|
* if (flow <= maxCapacity || flow == -1) { isWorking = true; } else {
|
|
* if (flow <= maxCapacity || flow == -1) { isWorking = true; } else {
|
|
- * isWorking = false; state = false; }
|
|
|
|
|
|
+ * isWorking = false; state = false;
|
|
**/
|
|
**/
|
|
}
|
|
}
|
|
|
|
|
|
@@ -113,6 +115,7 @@ public class CpsEdge {
|
|
* Calculates the state of the edge (see description of isWorking).
|
|
* Calculates the state of the edge (see description of isWorking).
|
|
*
|
|
*
|
|
* @param simMode
|
|
* @param simMode
|
|
|
|
+ * Simulation Mode
|
|
*/
|
|
*/
|
|
|
|
|
|
public void calculateState(boolean simMode) {
|
|
public void calculateState(boolean simMode) {
|
|
@@ -167,6 +170,7 @@ public class CpsEdge {
|
|
* Set the state manually to a new one.
|
|
* Set the state manually to a new one.
|
|
*
|
|
*
|
|
* @param state
|
|
* @param state
|
|
|
|
+ * the state
|
|
*/
|
|
*/
|
|
public void setState(boolean state) {
|
|
public void setState(boolean state) {
|
|
isWorking = state;
|
|
isWorking = state;
|
|
@@ -175,7 +179,7 @@ public class CpsEdge {
|
|
/**
|
|
/**
|
|
* Getter for the status.
|
|
* Getter for the status.
|
|
*
|
|
*
|
|
- * @return
|
|
|
|
|
|
+ * @return the state
|
|
*/
|
|
*/
|
|
public boolean getState() {
|
|
public boolean getState() {
|
|
return isWorking;
|
|
return isWorking;
|
|
@@ -185,6 +189,7 @@ public class CpsEdge {
|
|
* set the tags into a new set of tags.
|
|
* set the tags into a new set of tags.
|
|
*
|
|
*
|
|
* @param tags
|
|
* @param tags
|
|
|
|
+ * tags for this edge
|
|
*/
|
|
*/
|
|
public void setTags(ArrayList<Integer> tags) {
|
|
public void setTags(ArrayList<Integer> tags) {
|
|
this.tags = tags;
|
|
this.tags = tags;
|
|
@@ -193,7 +198,7 @@ public class CpsEdge {
|
|
/**
|
|
/**
|
|
* Getter for the ArrayList of tags.
|
|
* Getter for the ArrayList of tags.
|
|
*
|
|
*
|
|
- * @return
|
|
|
|
|
|
+ * @return tags tags for this edge
|
|
*/
|
|
*/
|
|
public ArrayList<Integer> getTags() {
|
|
public ArrayList<Integer> getTags() {
|
|
return tags;
|
|
return tags;
|
|
@@ -202,7 +207,7 @@ public class CpsEdge {
|
|
/**
|
|
/**
|
|
* Add a new tag to the ArrayList.
|
|
* Add a new tag to the ArrayList.
|
|
*
|
|
*
|
|
- * @param tag
|
|
|
|
|
|
+ * @param tag tag for the ArrayList
|
|
*/
|
|
*/
|
|
public void addTag(int tag) {
|
|
public void addTag(int tag) {
|
|
tags.add(tag);
|
|
tags.add(tag);
|