Changeset 490 for DCWoRMS/trunk/src/simulator/ConfigurationOptions.java
- Timestamp:
- 10/09/12 13:58:06 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/trunk/src/simulator/ConfigurationOptions.java
r477 r490 8 8 import java.util.PropertyResourceBundle; 9 9 import java.util.ResourceBundle; 10 import java.util.logging.FileHandler;11 10 12 11 /** … … 53 52 public static final String READ_SCENARIO_INPUT_FOLDER = READ_SCENARIO_MODIFIER 54 53 + ".inputfolder"; 55 public static final String READ_SCENARIO_INPUT_TAR = READ_SCENARIO_MODIFIER+ ".tar";56 54 57 55 /** The name of the workload file */ … … 59 57 + ".workloadfilename"; 60 58 61 /** Shall a detailed history be printed */62 public static final String PRINT_HISTORY_MODIFIER = "printhistory";63 64 59 /** The default name of a workload file */ 65 60 public static final String DEFAULT_WORKLOAD_FILE_NAME = "workload.swf"; 66 61 67 62 public static final String CREATE_XML_SUPPLEMENT_FILES = "createXMLSupplement"; 68 69 public static final String PROVIDER_LIST_FILE = "in/provider.list"; 70 71 /** Network topology file path */ 72 public static final String NETWORK_TOPOLOGY_FILE_MODIFIER = "networktopologyfilename"; 63 73 64 74 65 public static final String CREATEDIAGRAMS = "creatediagrams"; … … 79 70 public static final String CREATEDIAGRAMS_TASKS = CREATEDIAGRAMS + ".tasks"; 80 71 public static final String CREATEDIAGRAMS_TASKSWAITINGTIME = CREATEDIAGRAMS + ".taskswaitingtime"; 81 public static final String CREATEDIAGRAMS_RESERVATIONS = CREATEDIAGRAMS + ".reservations";82 72 83 73 public static final String CREATESTATISTICS = "createstatistics"; 84 74 public static final String ACCUMULATED_RESOURCES_STATISTICS = CREATESTATISTICS + ".accumulatedresources"; 85 75 public static final String EXTENDED_TASKS_STATISTICS = CREATESTATISTICS + ".extendedtasks"; 86 public static final String GRIDLET_HISTORY_STATISTICS = CREATESTATISTICS + ".gridlethistory";87 76 public static final String JOBS_STATISTICS = CREATESTATISTICS + ".jobs"; 88 77 public static final String SIMULATION_STATISTICS = CREATESTATISTICS + ".simulation"; … … 111 100 /* =============================================================================================== */ 112 101 113 public String providerListFile = null;114 102 115 103 … … 152 140 public String inputWorkloadFileName = DEFAULT_WORKLOAD_FILE_NAME; 153 141 154 /**155 * a txt file name with topology description156 */157 public String networkTopologyFileName = null;158 142 159 143 /** … … 171 155 public boolean overwriteFiles = false; 172 156 173 /**174 * true if the history files are to be generated (makes the simulation175 * slower)176 */177 public boolean printHistory = false;178 157 179 158 /** … … 183 162 184 163 public boolean creatediagrams_processors = true; 185 public boolean creatediagrams_reservations = true;186 164 public boolean creatediagrams_resources = true; 187 165 public boolean creatediagrams_energyusage = true; 188 166 public boolean creatediagrams_tasks = true; 189 167 public boolean creatediagrams_taskswaitingtime = true; 190 public double 168 public double creatediagrams_resources_scale = 1; 191 169 192 170 public boolean createaccumulatedresourcesstatistics = true; 193 171 public boolean createextendedtasksstatistics = true; 194 public boolean creategridlethistorystatistics = true;195 172 public boolean createjobsstatistics = true; 196 173 public boolean createsimulationstatistics = true; 197 174 public boolean formatstatisticsoutput = false; 198 175 199 public static final String ENV_DESC_MODIFIER = "envdesc"; 200 public String envDescFileName = null; 176 public String[] resForEnergyChart; 177 public String[] resForUtilizationChart; 178 201 179 /** 202 180 * An empty constructor. … … 231 209 232 210 co.resdescFileName = bundle.getString(RESOURCE_DESC_MODIFIER); 233 234 try { 235 co.envDescFileName = bundle.getString(ENV_DESC_MODIFIER); 236 } catch(MissingResourceException e){ 237 co.envDescFileName = null; 238 } 211 239 212 240 213 try { … … 264 237 } 265 238 266 267 try {268 co.networkTopologyFileName = bundle269 .getString(NETWORK_TOPOLOGY_FILE_MODIFIER);270 } catch(MissingResourceException e){271 co.networkTopologyFileName = null;272 }273 274 239 if (co.createScenario == false) { 275 240 // read scenario … … 279 244 } catch (MissingResourceException e) { 280 245 co.inputFolder = null; 281 }282 283 try {284 co.inputTar = getSeparatorTerminatedPath(bundle285 .getString(READ_SCENARIO_INPUT_TAR));286 } catch (MissingResourceException e) {287 co.inputTar = null;288 246 } 289 247 … … 307 265 co.createXMLSupplement = false; 308 266 } 309 310 try { 311 co.printHistory = Boolean.valueOf( 312 bundle.getString(PRINT_HISTORY_MODIFIER)).booleanValue(); 313 } catch(MissingResourceException e){ 314 co.printHistory = false; 315 } 316 267 317 268 // create diagrams 318 269 … … 330 281 co.creatediagrams_processors = createDiagrams; 331 282 } 332 try { 333 co.creatediagrams_reservations = Boolean.valueOf( 334 bundle.getString(CREATEDIAGRAMS_RESERVATIONS)).booleanValue() && createDiagrams; 335 } catch(MissingResourceException e){ 336 co.creatediagrams_reservations = createDiagrams; 337 } 338 try { 339 co.creatediagrams_resources = Boolean.valueOf( 340 bundle.getString(CREATEDIAGRAMS_UTILIZATION)).booleanValue() && createDiagrams; 283 284 try { 285 co.resForUtilizationChart = bundle.getString(CREATEDIAGRAMS_UTILIZATION).split(";"); 286 if(co.resForUtilizationChart.length > 0){ 287 co.creatediagrams_resources = true && createDiagrams; 288 } 341 289 } catch(MissingResourceException e){ 342 290 co.creatediagrams_resources = createDiagrams; … … 349 297 } 350 298 try { 351 co.creatediagrams_energyusage = Boolean.valueOf( 352 bundle.getString(CREATEDIAGRAMS_ENERGYUSAGE)).booleanValue() && createDiagrams; 299 co.resForEnergyChart = bundle.getString(CREATEDIAGRAMS_ENERGYUSAGE).split(";"); 300 if(co.resForEnergyChart.length > 0){ 301 co.creatediagrams_energyusage = true && createDiagrams; 302 } 353 303 } catch(MissingResourceException e){ 354 304 co.creatediagrams_energyusage = createDiagrams; … … 367 317 } 368 318 369 370 319 try { 371 320 co.statsOutputSubfolderNameCreate = bundle.getString(STATS_OUTPUT_SUBFOLDER_NAME); … … 388 337 co.createextendedtasksstatistics = true; 389 338 } 390 try { 391 co.creategridlethistorystatistics = Boolean.valueOf( 392 bundle.getString(GRIDLET_HISTORY_STATISTICS)).booleanValue(); 393 } catch(MissingResourceException e){ 394 co.creategridlethistorystatistics = true; 395 } 339 396 340 try { 397 341 co.createjobsstatistics = Boolean.valueOf( … … 419 363 } 420 364 return co; 421 }422 423 /**424 * Creates a new configuration object in the CREATE_SCENARIO mode.425 *426 * @param gridSchedulingPluginName427 * @param forecastFinishTimePluginName428 * @param localAllocPolicyPluginName429 * @param resdescFileName430 * @param taskParamFileName431 * @param outputFolder432 * @param outputWorkloadFileName433 * @param overwriteFiles434 * @param printHistory435 */436 public ConfigurationOptions(String gridSchedulingPluginName,437 String exectimeestimationplugin,438 String localAllocPolicyPluginName, String resdescFileName,439 String taskParamFileName, String outputFolder,440 String outputWorkloadFileName, boolean overwriteFiles,441 boolean printHistory) {442 super();443 this.resdescFileName = resdescFileName;444 this.workloadDescFileName = taskParamFileName;445 this.outputFolder = getSeparatorTerminatedPath(outputFolder);446 this.outputWorkloadFileName = outputWorkloadFileName;447 this.overwriteFiles = overwriteFiles;448 this.printHistory = printHistory;449 450 // the create mode451 this.createScenario = true;452 }453 454 /**455 * Creates a new configuration object in the READ_SCENARIO mode.456 *457 * @param gridSchedulingPluginName458 * @param forecastFinishTimePluginName459 * @param localAllocPolicyPluginName460 * @param resdescFileName461 * @param inputFolder462 * @param inputWorkloadFileName463 * @param overwriteFiles464 * @param printHistory465 */466 public ConfigurationOptions(String gridSchedulingPluginName,467 String exectimeestimationplugin,468 String localAllocPolicyPluginName, String resdescFileName,469 String inputFolder, String inputWorkloadFileName,470 boolean overwriteFiles, boolean printHistory) {471 super();472 this.resdescFileName = resdescFileName;473 this.inputFolder = getSeparatorTerminatedPath(inputFolder);474 this.inputWorkloadFileName = inputWorkloadFileName;475 this.overwriteFiles = overwriteFiles;476 this.printHistory = printHistory;477 //FileHandler.loadDataset(new File("iris.data"), 4, ",");478 // the read mode479 this.createScenario = false;480 365 } 481 366
Note: See TracChangeset
for help on using the changeset viewer.