public class GridBasedExploration extends Explorer
Modifier and Type | Field and Description |
---|---|
private java.util.List<Point> |
algoSatPointsList
SAT points in the exploration.
|
private java.util.List<Point> |
algoUnsatPointsList
UNSAT points in the exploration.
|
private double |
epsilon
Current epsilon value of the grid.
|
private int[] |
lowerBounds
Lower bounds for the exploration.
|
private java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
paretoModelList
Model for every Pareto point from the exploration.
|
private java.util.List<Point> |
paretoPoints
List of Pareto Points from the exploration.
|
private java.util.List<Point> |
satPointsList
List of all the SAT points explored.
|
private java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
satPointsModelList
Model for every SAT point discovered in the exploration.
|
private int[] |
upperBounds
Upper bounds for the exploration.
|
dimensions, exploredPointsFileName, explorePointsfile, explParams, modelFile, modelFileName, outputDir, paretoPointsfile, paretoPointsFileName, perQuerytimeOutInSeconds, satPointsfile, satPointsFileName, timedOutPointsfile, timedOutPointsFileName, timeTakenForCurrentQuery, totalExplTime, totalQueryTimeOutInSeconds, unSatPointsfile, unsatPointsFileName
Constructor and Description |
---|
GridBasedExploration(java.lang.String opDir,
int perQueryTimeOutSeconds,
int totalTimeOutInSeconds,
ExplorationParameters explParams)
Initialize the grid-based explorer.
|
Modifier and Type | Method and Description |
---|---|
private void |
addSatToList(Point point)
Add SAT point to the list.
|
private void |
addUnsatToList(Point point)
Add UNSAT point to the list.
|
private boolean |
binarySearch(int dimension,
double lowerBound,
double upperBound,
Point queryPoint,
double higherDimEpsilon)
Perform a binary search on a given dimension.
|
private void |
calcParetoPoints()
Calculate Pareto points from the list of SAT and UNSAT points
|
private boolean |
checkIfExplorationGranularityReached()
Check if the granularity of the exploration has reached for each dimension.
|
private Z3Solver.SatResult |
checkIfSatOrUnsat(Point point)
Check if the point falls in SAT or UNSAT known area.
|
private boolean |
containsLowestPoint()
If the exploration happens such that the point (0,0) returns a SAT value,
then there is no need in exploring other points, because it will anyways
dominate all the other points.
|
void |
explore()
Perform grid-based exploration
|
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
getParetoModels()
Get list of model for each Pareto point found in exploration.
|
java.util.List<Point> |
getParetoPoints()
Get all the Pareto points found from this exploration.
|
java.util.List<Point> |
getSatPoints()
Get list of all the SAT points found during the exploration.
|
private double[] |
getTrueBounds(Point queryPoint)
Get bounds according to the unknown area where we should perform the binary search
exploration.
|
private Z3Solver.SatResult |
performQuery(Point queryPoint)
Perform a SMT query.
|
private double |
pointToValue(int dimension,
double epsilon,
int point)
Calculate where the point would reside in the design space.
|
private void |
printLimitInfo()
Prints the upper, lower bounds and exploration granularity.
|
void |
readExploredPoints(java.lang.String resultsDirectory)
If we want to continue a previous exploration, we could just read the log file and
continue from the point where the exploration stopped.
|
private void |
readFileToArray(java.lang.String fileName,
java.lang.String[] paramStrings,
java.util.List<Point> listToAdd)
Read a log file of exploration to read SAT / UNSAT / TIMED OUT points.
|
private void |
readModelFile(java.lang.String fileName,
java.util.List<java.util.Map<java.lang.String,java.lang.String>> satPointsModelList)
Convert the string in the model file to List of model maps.
|
finalize, outputToFile, smtQuery
private double epsilon
private java.util.List<Point> satPointsList
private java.util.List<Point> paretoPoints
private java.util.List<java.util.Map<java.lang.String,java.lang.String>> satPointsModelList
private java.util.List<java.util.Map<java.lang.String,java.lang.String>> paretoModelList
private java.util.List<Point> algoSatPointsList
private java.util.List<Point> algoUnsatPointsList
private int[] lowerBounds
private int[] upperBounds
public GridBasedExploration(java.lang.String opDir, int perQueryTimeOutSeconds, int totalTimeOutInSeconds, ExplorationParameters explParams)
opDir
- output directory to write all the log filesperQueryTimeOutSeconds
- time out per query in secondstotalTimeOutInSeconds
- global time out in seconds for all the explorationexplParams
- Exploration parametersprivate void addUnsatToList(Point point)
point
- new point to be addedprivate void addSatToList(Point point)
point
- new point to be addedprivate void readModelFile(java.lang.String fileName, java.util.List<java.util.Map<java.lang.String,java.lang.String>> satPointsModelList)
fileName
- name of the model filesatPointsModelList
- list where SAT models will be stored.private void readFileToArray(java.lang.String fileName, java.lang.String[] paramStrings, java.util.List<Point> listToAdd)
fileName
- name of the file to be readparamStrings
- String in the file between the information fieldlistToAdd
- list where all the read points will be storedpublic void readExploredPoints(java.lang.String resultsDirectory)
resultsDirectory
- the directory where all the log files are stored.public java.util.List<Point> getSatPoints()
public java.util.List<Point> getParetoPoints()
public java.util.List<java.util.Map<java.lang.String,java.lang.String>> getParetoModels()
private void calcParetoPoints()
private boolean checkIfExplorationGranularityReached()
private Z3Solver.SatResult performQuery(Point queryPoint)
queryPoint
- The point where the query should be asked.private double pointToValue(int dimension, double epsilon, int point)
dimension
- dimension where the value is to be obtainedepsilon
- current epsilon valuepoint
- the number of pointprivate boolean binarySearch(int dimension, double lowerBound, double upperBound, Point queryPoint, double higherDimEpsilon)
dimension
- dimension to be exploredlowerBound
- lower bound to be exploredupperBound
- upper bound to be exploredqueryPoint
- current Point which is being queriedhigherDimEpsilon
- epsilon to be used for the higher dimensionprivate double[] getTrueBounds(Point queryPoint)
queryPoint
- Current query point under considerationprivate boolean containsLowestPoint()
private void printLimitInfo()
public void explore()
private Z3Solver.SatResult checkIfSatOrUnsat(Point point)
point
- point to be checked if it falls in unknown area