@@ -37,6 +37,7 @@ public class SimulationCache {
3737//ArrayList<MeasureType> MeasureList;
3838 private ArrayList <SimulationType > simulationList ;
3939 private int localSimulationCounter = 0 ;
40+ private String tmpHash = "" ;
4041
4142 public SimulationCache () {
4243 //this.MeasureList = new ArrayList<MeasureType>();
@@ -293,21 +294,26 @@ public boolean checkIfAllParameterMatchTable(parameterTableModel myTableModel) {
293294 }
294295
295296 /**
296- * Returns all Measures, selected by one parameterset(ParameterList)
297+ * Returns all Measures, selected by one parameterset(ParameterList).
298+ *
299+ * It will just compare the hash values of the sorted parameterLists!
297300 *
298301 * @param parameterList given Set of Parameters to by virtually simulated
299302 * @return ArrayList of MeasureTypes
300303 */
301304 public ArrayList <MeasureType > getAllMeasuresWithParameterList (ArrayList <parameter > parameterList ) {
302305 SimulationType tmpSimulation ;
303306 ArrayList <MeasureType > myTmpList = new ArrayList ();
307+ tmpHash = support .getHashStringForParameterList (parameterList );
308+ //support.log(tmpHash + " = Needle.", typeOfLogLevel.VERBOSE);
304309
305310 //support.log("Size of All Measures from File: "+MeasureList.size());
306311 //Go through all Measures, find the one with the same parameterlist
307312 for (int i = 0 ; i < this .getSimulationList ().size (); i ++) {
308313 tmpSimulation = this .getSimulationList ().get (i );
309- if (compareParameterList (parameterList , tmpSimulation .getListOfParameters ())) {
310- myTmpList = tmpSimulation .getMeasures (); //assumming cache-file did not have experiments with same Parameterset
314+ //if (compareParameterList(parameterList, tmpSimulation.getListOfParameters())) {
315+ if (tmpHash .equals (tmpSimulation .getHashString ())) {
316+ myTmpList = tmpSimulation .getMeasures (); //assuming cache-file did not have experiments with same Parameterset
311317 }
312318 }
313319 return myTmpList ;
@@ -479,16 +485,31 @@ public ArrayList<SimulationType> getListOfCompletedSimulationParsers(ArrayList<A
479485 setLocalSimulationCounter (simulationCounter );
480486 ArrayList <SimulationType > myParserList = new ArrayList <SimulationType >();
481487
482- for (ArrayList <parameter > parameterSet : parameterSetList ) {
488+ support .log ("Updating all simulation hash values." , typeOfLogLevel .INFO );
489+ for (int i = 0 ; i < this .getSimulationList ().size (); i ++) {
490+ this .getSimulationList ().get (i ).updateHashString ();
491+ support .setStatusText ("Updating Hashs: " + i * 100 / this .getSimulationList ().size () + " %" );
492+ if (support .isCancelEverything ()) {
493+ return null ;
494+ }
495+ }
496+ support .log ("All hash values in cache up to date." , typeOfLogLevel .VERBOSE );
497+
498+ //for (ArrayList<parameter> parameterSet : parameterSetList) {
499+ for (int i = 0 ; i < parameterSetList .size (); i ++) {
500+ ArrayList <parameter > parameterSet = parameterSetList .get (i );
501+
483502 //Create Arraylist from array of parameters
484503 /*ArrayList<parameter> tmpParameterList = new ArrayList<parameter>();
485504 for (parameter myParameter : parameterSet) {
486505 tmpParameterList.add(myParameter);
487506 }*/
488507 support .spinInLabel ();
508+
509+ support .setStatusText ("Searching in cache: " + i * 100 / parameterSetList .size () + " %" );
489510 //Get local simulation results
490511 ArrayList <MeasureType > listOfMeasureWithGivenParameters = this .getAllMeasuresWithParameterList (parameterSet );
491- // support.log("Size of ParameterList: "+ tmpParameterList .size() + " results in " +listOfMeasureWithGivenParameters.size()+ " Measurements.");
512+ support .log ("Size of ParameterList: " + parameterSet .size () + " results in " + listOfMeasureWithGivenParameters .size () + " Measurements." , typeOfLogLevel . VERBOSE );
492513 //append if listSize is > 0
493514 if (listOfMeasureWithGivenParameters .size () > 0 ) {
494515 /*SimulationType tmpParser=new SimulationType();
0 commit comments