forked from WorkflowSim/WorkflowSim-1.0
-
Notifications
You must be signed in to change notification settings - Fork 0
How to Add Your Properties
Weiwei Chen edited this page Aug 31, 2013
·
16 revisions
If you have a new property to use in WorkflowSim and would like to configure it in the configuration file, below we show the steps:
- Assume we would like to add a deadline of a workflow and it's a long variable. In org.workflowsim.utils.Parameters.java, we add: private static long deadline; public static void init(..., long dl) { ... //other parameters deadline = dl; } public static long getDeadline(){ return deadline; } Because Parameters is a static object and in this way we can access deadline in any place.
- Add parsing in org.workflowsim.utils.ArgumentParser.java public ArgumentParser(String[] args) { long deadline = 0; if ...//other parameter parsing else if (key.equals("deadline")) { deadline = Long.parseLong(value); } Parameters.init(..., deadline); } This means we set the deadline of Parameters while we parsing a config file 3.Add deadline in config.txt Just add in your config.txt deadline = 10000
- Then you can get deadline in your scheduler, i.e. in RandomPlanner.java long deadline = Parameters.getDeadline();