use of org.cpsolver.ifs.util.ProgressWriter in project cpsolver by UniTime.
the class Test method main.
public static void main(String[] args) {
try {
Progress.getInstance().addProgressListener(new ProgressWriter(System.out));
if (args.length == 0) {
ToolBox.configureLogging();
DataProperties config = new DataProperties(System.getProperties());
config.setProperty("Termination.StopWhenComplete", "false");
config.setProperty("Termination.TimeOut", "60");
config.setProperty("General.Output", System.getProperty("user.dir"));
test2(config);
return;
}
File inputCfg = new File(args[0]);
DataProperties properties = ToolBox.loadProperties(inputCfg);
if (args.length == 3) {
File xmlFile = new File(args[1]);
String outDir = args[2] + File.separator + (sDateFormat.format(new Date()));
properties.setProperty("General.Output", outDir.toString());
System.out.println("Input file: " + xmlFile);
System.out.println("Output folder: " + properties.getProperty("General.Output"));
(new File(outDir)).mkdirs();
ToolBox.configureLogging(outDir, null);
test3(properties, xmlFile);
} else if (properties.getProperty("INCLUDE_REGEXP") != null) {
test(inputCfg, null, null, properties.getProperty("INCLUDE_REGEXP"), (args.length > 1 ? args[1] : null));
} else {
String outDir = properties.getProperty("General.Output", ".") + File.separator + inputCfg.getName().substring(0, inputCfg.getName().lastIndexOf('.')) + File.separator + sDateFormat.format(new Date());
if (args.length > 1)
outDir = args[1] + File.separator + (sDateFormat.format(new Date()));
properties.setProperty("General.Output", outDir.toString());
System.out.println("Output folder: " + properties.getProperty("General.Output"));
(new File(outDir)).mkdirs();
ToolBox.configureLogging(outDir, null);
test2(properties);
}
} catch (Exception e) {
e.printStackTrace();
}
}
use of org.cpsolver.ifs.util.ProgressWriter in project cpsolver by UniTime.
the class Test method main.
public static void main(String[] args) {
try {
Progress.getInstance().addProgressListener(new ProgressWriter(System.out));
File inputCfg = new File(args[0]);
DataProperties properties = ToolBox.loadProperties(inputCfg);
String outDir = properties.getProperty("General.Output", ".") + File.separator + inputCfg.getName().substring(0, inputCfg.getName().lastIndexOf('.')) + File.separator + sDateFormat.format(new Date());
(new File(outDir)).mkdirs();
properties.setProperty("General.Output", outDir.toString());
ToolBox.configureLogging(outDir, null);
test(properties);
} catch (Exception e) {
e.printStackTrace();
}
}
use of org.cpsolver.ifs.util.ProgressWriter in project cpsolver by UniTime.
the class Test method batchSectioning.
/** Batch sectioning test
* @param cfg solver configuration
* @return resultant solution
**/
public static Solution<Request, Enrollment> batchSectioning(DataProperties cfg) {
Solution<Request, Enrollment> solution = load(cfg);
if (solution == null)
return null;
StudentSectioningModel model = (StudentSectioningModel) solution.getModel();
if (cfg.getPropertyBoolean("Test.ComputeSectioningInfo", true))
model.clearOnlineSectioningInfos();
Progress.getInstance(model).addProgressListener(new ProgressWriter(System.out));
solve(solution, cfg);
return solution;
}
use of org.cpsolver.ifs.util.ProgressWriter in project cpsolver by UniTime.
the class Test method main.
/**
* RPP test.
*
* @param args
* the command line arguments
*/
public static void main(String[] args) {
try {
Progress.getInstance().addProgressListener(new ProgressWriter(System.out));
File inputCfg = new File(args[0]);
DataProperties properties = ToolBox.loadProperties(inputCfg);
if (properties.getProperty("INCLUDE_REGEXP") != null) {
if (args.length > 1)
properties.setProperty("General.Output", args[1]);
test(inputCfg, null, null, properties.getProperty("INCLUDE_REGEXP"), (args.length > 1 ? args[1] : null));
} else {
String outDir = properties.getProperty("General.Output", ".") + File.separator + inputCfg.getName().substring(0, inputCfg.getName().lastIndexOf('.')) + File.separator + sDateFormat.format(new Date());
if (args.length > 1)
outDir = args[1] + File.separator + (sDateFormat.format(new Date()));
(new File(outDir)).mkdirs();
properties.setProperty("General.Output", outDir.toString());
System.out.println("Output folder: " + properties.getProperty("General.Output"));
ToolBox.configureLogging(outDir, null);
boolean mpp = properties.getPropertyBoolean("General.MPP", false);
if (mpp)
testMPP(properties);
else
test(properties);
}
} catch (Exception e) {
e.printStackTrace();
}
}
use of org.cpsolver.ifs.util.ProgressWriter in project cpsolver by UniTime.
the class Test method main.
public static void main(String[] args) {
try {
Progress.getInstance().addProgressListener(new ProgressWriter(System.out));
File inputCfg = new File(args[0]);
DataProperties properties = ToolBox.loadProperties(inputCfg);
if (properties.getProperty("INCLUDE_REGEXP") != null) {
test(inputCfg, null, null, properties.getProperty("INCLUDE_REGEXP"), (args.length > 1 ? args[1] : null));
} else {
String outDir = properties.getProperty("General.Output", ".") + File.separator + inputCfg.getName().substring(0, inputCfg.getName().lastIndexOf('.')) + File.separator + sDateFormat.format(new Date());
if (args.length > 1)
outDir = args[1] + File.separator + (sDateFormat.format(new Date()));
properties.setProperty("General.Output", outDir.toString());
System.out.println("Output folder: " + properties.getProperty("General.Output"));
(new File(outDir)).mkdirs();
ToolBox.configureLogging(outDir, null);
test(properties);
}
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations