|
|
|
@ -26,22 +26,19 @@ |
|
|
|
|
|
|
|
package prism; |
|
|
|
|
|
|
|
import java.text.DecimalFormat; |
|
|
|
import java.text.DecimalFormatSymbols; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.HashSet; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import parser.ast.Expression; |
|
|
|
|
|
|
|
/** |
|
|
|
* This class represent a list of tiles which have corners in Pareto points, |
|
|
|
* and which represent an underapproximation of the Pareto curve. |
|
|
|
* and which represent an under-approximation of the Pareto curve. |
|
|
|
*/ |
|
|
|
public class TileList |
|
|
|
{ |
|
|
|
/** |
|
|
|
* Threshold for approximation of the pareto curve. |
|
|
|
* Threshold for approximation of the Pareto curve. |
|
|
|
*/ |
|
|
|
private double tolerance; |
|
|
|
|
|
|
|
@ -52,7 +49,8 @@ public class TileList |
|
|
|
*/ |
|
|
|
private OpsAndBoundsList opsAndBoundsList; |
|
|
|
|
|
|
|
public OpsAndBoundsList getOpsAndBoundsList() { |
|
|
|
public OpsAndBoundsList getOpsAndBoundsList() |
|
|
|
{ |
|
|
|
return this.opsAndBoundsList; |
|
|
|
} |
|
|
|
|
|
|
|
@ -62,29 +60,33 @@ public class TileList |
|
|
|
* returned in any reasonable way. |
|
|
|
* |
|
|
|
* To ensure correct concurrent behaviour, object accessing any stored tile lists |
|
|
|
* or elements should synchronize on this object; |
|
|
|
* or elements should synchronise on this object; |
|
|
|
*/ |
|
|
|
protected static List<TileList> storedTileLists; |
|
|
|
|
|
|
|
public static List<TileList> getStoredTileLists() |
|
|
|
{ |
|
|
|
return storedTileLists; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Formulas for X and Y axes (or multiobj formulas) of the corresponding |
|
|
|
* Formulas for X and Y axes (or multi-obj formulas) of the corresponding |
|
|
|
* elements of storedTileLists. |
|
|
|
*/ |
|
|
|
protected static List<Expression> storedFormulasX; |
|
|
|
protected static List<Expression> storedFormulasY; |
|
|
|
protected static List<Expression> storedFormulas; |
|
|
|
|
|
|
|
public static List<Expression> getStoredFormulasX() |
|
|
|
{ |
|
|
|
return storedFormulasX; |
|
|
|
} |
|
|
|
|
|
|
|
public static List<Expression> getStoredFormulasY() |
|
|
|
{ |
|
|
|
return storedFormulasY; |
|
|
|
} |
|
|
|
|
|
|
|
public static List<Expression> getStoredFormulas() |
|
|
|
{ |
|
|
|
return storedFormulas; |
|
|
|
@ -99,8 +101,7 @@ public class TileList |
|
|
|
TileList.storedTileLists.clear(); |
|
|
|
} |
|
|
|
|
|
|
|
static |
|
|
|
{ |
|
|
|
static { |
|
|
|
storedFormulasX = new ArrayList<Expression>(); |
|
|
|
storedFormulasY = new ArrayList<Expression>(); |
|
|
|
storedFormulas = new ArrayList<Expression>(); |
|
|
|
@ -145,7 +146,8 @@ public class TileList |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public String toString() { |
|
|
|
public String toString() |
|
|
|
{ |
|
|
|
String s = "["; |
|
|
|
boolean first = true; |
|
|
|
for (int j = 0; j < this.list.size(); j++) { |
|
|
|
@ -194,8 +196,7 @@ public class TileList |
|
|
|
//we have to exhaust the boundaries first |
|
|
|
while (this.currentProjectionIndex < this.dim) { |
|
|
|
for (Tile t : list) { |
|
|
|
if (!t.isUpperBound(this.currentProjectionIndex) |
|
|
|
&& t.liesOnBoundary(this.currentProjectionIndex)) { |
|
|
|
if (!t.isUpperBound(this.currentProjectionIndex) && t.liesOnBoundary(this.currentProjectionIndex)) { |
|
|
|
t.hyperplaneSuggested = true; |
|
|
|
//System.out.println("fresh candidate hyperplane:" + t + "with weight " + Tile.getWeightsForTile(t)); |
|
|
|
Point ret = Tile.getWeightsForTile(t); |
|
|
|
@ -232,7 +233,7 @@ public class TileList |
|
|
|
/** |
|
|
|
* Returns the number of different points that form the tiles of this |
|
|
|
* TileList. The implementation is rather inefficient and is intended |
|
|
|
* only for debugging pusposes. |
|
|
|
* only for debugging purposes. |
|
|
|
*/ |
|
|
|
public int getNumberOfDifferentPoints() |
|
|
|
{ |
|
|
|
@ -263,14 +264,11 @@ public class TileList |
|
|
|
public void addNewPoint(Point point) throws PrismException |
|
|
|
{ |
|
|
|
//first create the projection to the boundary |
|
|
|
if (this.currentProjectionIndex < this.dim && |
|
|
|
point.getCoord(this.currentProjectionIndex) > 0.0) { |
|
|
|
if (this.currentProjectionIndex < this.dim && point.getCoord(this.currentProjectionIndex) > 0.0) { |
|
|
|
Point projectionPoint = point.clone(); |
|
|
|
projectionPoint.setCoord(this.currentProjectionIndex, 0.0); |
|
|
|
splitTilesByPoint(projectionPoint, false); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
} else { |
|
|
|
splitTilesByPoint(point, this.currentProjectionIndex == dim); |
|
|
|
} |
|
|
|
} |
|
|
|
|