Added option to specify output directory.

This commit is contained in:
leandrohw 2018-01-19 12:37:28 -07:00
parent 54489ea578
commit e8ab157cd9
3 changed files with 24 additions and 5 deletions

View file

@ -25,6 +25,8 @@ where
| Options | Description |
| ------------- | ------------- |
| -d [value] | project directory |
|-p [value] | loads a properties file |
| -outDir [value] | where the output should be stored |
| -ti [value] | non-negative double initial simulation time |
| -tl [value] | non-negative double simulation time limit |
| -ot [value] | non-negative double output time |

View file

@ -60,6 +60,8 @@ import edu.utah.ece.async.ibiosim.dataModels.util.observe.BioObserver;
* <li>Optional:</li>
* <ul>
* <li>-d [value]: project directory</li>
* <li>-p [value]: loads a properties file</li>
* <li>-outDir [value]: where the output should be stored </li>
* <li>-ti [value]: non-negative double initial simulation time</li>
* <li>-tl [value]: non-negative double simulation time limit</li>
* <li>-ot [value]: non-negative double for output time</li>
@ -117,6 +119,8 @@ public class Analysis implements BioObserver
System.err.println("\t input: combine archive, sed-ml, or sbml file.");
System.err.println("Options:\n");
System.err.println("\t -d [value]: project directory");
System.err.println("\t -p [value]: loads a properties file");
System.err.println("\t -outDir [value]: where the output should be stored");
System.err.println("\t -ti [value]: initial simulation time");
System.err.println("\t -tl [value]: simulation time limit");
System.err.println("\t -ot [value]: output time");
@ -207,6 +211,11 @@ public class Analysis implements BioObserver
case "-data":
analysis.propertiesMap.put(data, value);
break;
case "-outDir":
analysis.properties.setOutDir(value);
File file = new File(value);
file.mkdirs();
break;
default:
usage();
}
@ -258,6 +267,7 @@ public class Analysis implements BioObserver
AnalysisPropertiesLoader.loadPropertiesFile(properties);
}
loadUserValues(propertiesMap);
AnalysisPropertiesWriter.createProperties(properties);
run.execute();
}
}
@ -507,30 +517,37 @@ public class Analysis implements BioObserver
if(value.equals("ode"))
{
properties.setSim("rkf45");
properties.setOde();
}
else if(value.equals("hode"))
{
properties.setSim("Runge-Kutta-Fehlberg (Hierarchical)");
properties.setOde();
}
else if(value.equals("ssa"))
{
properties.setSim("gillespie");
properties.setSsa();
}
else if(value.equals("hssa"))
{
properties.setSim("SSA-Direct (Hierarchical)");
properties.setSsa();
}
else if(value.equals("dfba"))
{
properties.setSim("Mixed-Hierarchical");
properties.setSsa();
}
else if(value.equals("jode"))
{
properties.setSim("Runge-Kutta-Fehlberg (Dynamic)");
properties.setOde();
}
else if(value.equals("jssa"))
{
properties.setSim("SSA-Direct (Dynamic)");
properties.setOde();
}
else
{

View file

@ -92,7 +92,7 @@ public class AnalysisPropertiesWriter {
properties.setProperty(reb2sac_abstraction_3 + (i + 1), analysisProperties.getAdvancedProperties().getPostAbs().get(i));
}
}
if(analysisProperties.getSimulationProperties().getPrinter_id() != null)
{
properties.setProperty(sim_printer, analysisProperties.getSimulationProperties().getPrinter_id());
@ -306,8 +306,8 @@ public class AnalysisPropertiesWriter {
properties.setProperty(mc_seed, String.valueOf(analysisProperties.getSimulationProperties().getRndSeed()));
properties.setProperty(mc_runs, String.valueOf(analysisProperties.getSimulationProperties().getRun()));
properties.setProperty(mc_start_index, String.valueOf(analysisProperties.getSimulationProperties().getStartIndex()));
properties.setProperty(ode_out_dir, analysisProperties.getOutDir());
}
properties.setProperty(mc_out_dir, analysisProperties.getOutDir());
}
properties.setProperty(sim_run_term , "constraint");
@ -332,7 +332,7 @@ public class AnalysisPropertiesWriter {
int numberOfSteps;
String fileStem = properties.getFileStem();
String simName = properties.getSim();
if (properties.isNumSteps())
{
numberOfSteps = properties.getSimulationProperties().getNumSteps();
@ -346,7 +346,7 @@ public class AnalysisPropertiesWriter {
if (!fileStem.trim().equals("")) {
taskId = properties.getId() + "__" + fileStem.trim();
}
AbstractTask task = sedml.getTaskWithId(taskId);
Simulation simulation = sedml.getSimulation(taskId+"_sim");
if (simulation != null) {