Ignore:
Timestamp:
10/09/12 13:58:06 (13 years ago)
Author:
wojtekp
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • DCWoRMS/trunk/src/simulator/ConfigurationOptions.java

    r477 r490  
    88import java.util.PropertyResourceBundle; 
    99import java.util.ResourceBundle; 
    10 import java.util.logging.FileHandler; 
    1110 
    1211/** 
     
    5352        public static final String READ_SCENARIO_INPUT_FOLDER = READ_SCENARIO_MODIFIER 
    5453                        + ".inputfolder"; 
    55         public static final String READ_SCENARIO_INPUT_TAR = READ_SCENARIO_MODIFIER+ ".tar"; 
    5654         
    5755        /** The name of the workload file */ 
     
    5957                        + ".workloadfilename"; 
    6058 
    61         /** Shall a detailed history be printed */ 
    62         public static final String PRINT_HISTORY_MODIFIER = "printhistory"; 
    63  
    6459        /** The default name of a workload file */ 
    6560        public static final String DEFAULT_WORKLOAD_FILE_NAME = "workload.swf"; 
    6661 
    6762        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 
    7364         
    7465        public static final String CREATEDIAGRAMS = "creatediagrams"; 
     
    7970        public static final String CREATEDIAGRAMS_TASKS = CREATEDIAGRAMS + ".tasks"; 
    8071        public static final String CREATEDIAGRAMS_TASKSWAITINGTIME = CREATEDIAGRAMS + ".taskswaitingtime"; 
    81         public static final String CREATEDIAGRAMS_RESERVATIONS = CREATEDIAGRAMS + ".reservations"; 
    8272         
    8373        public static final String CREATESTATISTICS = "createstatistics"; 
    8474        public static final String ACCUMULATED_RESOURCES_STATISTICS = CREATESTATISTICS + ".accumulatedresources"; 
    8575        public static final String EXTENDED_TASKS_STATISTICS = CREATESTATISTICS + ".extendedtasks"; 
    86         public static final String GRIDLET_HISTORY_STATISTICS = CREATESTATISTICS + ".gridlethistory"; 
    8776        public static final String JOBS_STATISTICS = CREATESTATISTICS + ".jobs"; 
    8877        public static final String SIMULATION_STATISTICS = CREATESTATISTICS + ".simulation"; 
     
    111100        /* =============================================================================================== */ 
    112101         
    113         public String providerListFile = null; 
    114102 
    115103 
     
    152140        public String inputWorkloadFileName = DEFAULT_WORKLOAD_FILE_NAME; 
    153141 
    154         /** 
    155          * a txt file name with topology description 
    156          */ 
    157         public String networkTopologyFileName = null; 
    158142         
    159143        /** 
     
    171155        public boolean overwriteFiles = false; 
    172156 
    173         /** 
    174          * true if the history files are to be generated (makes the simulation 
    175          * slower) 
    176          */ 
    177         public boolean printHistory = false; 
    178157         
    179158        /** 
     
    183162 
    184163        public boolean creatediagrams_processors = true; 
    185         public boolean creatediagrams_reservations = true; 
    186164        public boolean creatediagrams_resources = true; 
    187165        public boolean creatediagrams_energyusage = true; 
    188166        public boolean creatediagrams_tasks = true; 
    189167        public boolean creatediagrams_taskswaitingtime = true; 
    190         public double     creatediagrams_resources_scale = 1; 
     168        public double  creatediagrams_resources_scale = 1; 
    191169         
    192170        public boolean createaccumulatedresourcesstatistics = true; 
    193171        public boolean createextendedtasksstatistics = true; 
    194         public boolean creategridlethistorystatistics = true; 
    195172        public boolean createjobsstatistics = true; 
    196173        public boolean createsimulationstatistics = true; 
    197174        public boolean formatstatisticsoutput = false; 
    198175         
    199         public static final String ENV_DESC_MODIFIER = "envdesc"; 
    200         public String envDescFileName = null; 
     176        public String[] resForEnergyChart; 
     177        public String[] resForUtilizationChart; 
     178         
    201179        /** 
    202180         * An empty constructor. 
     
    231209                 
    232210                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 
    239212                 
    240213                try { 
     
    264237                } 
    265238 
    266  
    267                 try { 
    268                         co.networkTopologyFileName = bundle 
    269                                         .getString(NETWORK_TOPOLOGY_FILE_MODIFIER); 
    270                 } catch(MissingResourceException e){ 
    271                         co.networkTopologyFileName = null; 
    272                 } 
    273                  
    274239                if (co.createScenario == false) { 
    275240                        // read scenario 
     
    279244                        } catch (MissingResourceException e) { 
    280245                                co.inputFolder = null; 
    281                         } 
    282                          
    283                         try { 
    284                                 co.inputTar = getSeparatorTerminatedPath(bundle 
    285                                         .getString(READ_SCENARIO_INPUT_TAR)); 
    286                         } catch (MissingResourceException e) { 
    287                                 co.inputTar = null; 
    288246                        } 
    289247                         
     
    307265                        co.createXMLSupplement = false; 
    308266                } 
    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 
    317268                // create diagrams 
    318269                 
     
    330281                        co.creatediagrams_processors = createDiagrams; 
    331282                } 
    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                        } 
    341289                } catch(MissingResourceException e){ 
    342290                        co.creatediagrams_resources = createDiagrams; 
     
    349297                } 
    350298                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                        } 
    353303                } catch(MissingResourceException e){ 
    354304                        co.creatediagrams_energyusage = createDiagrams; 
     
    367317                } 
    368318                 
    369                  
    370319                try { 
    371320                        co.statsOutputSubfolderNameCreate = bundle.getString(STATS_OUTPUT_SUBFOLDER_NAME); 
     
    388337                        co.createextendedtasksstatistics = true; 
    389338                } 
    390                 try { 
    391                         co.creategridlethistorystatistics = Boolean.valueOf( 
    392                                         bundle.getString(GRIDLET_HISTORY_STATISTICS)).booleanValue(); 
    393                 } catch(MissingResourceException e){ 
    394                         co.creategridlethistorystatistics = true; 
    395                 } 
     339 
    396340                try { 
    397341                        co.createjobsstatistics = Boolean.valueOf( 
     
    419363                } 
    420364                return co; 
    421         } 
    422  
    423         /** 
    424          * Creates a new configuration object in the CREATE_SCENARIO mode. 
    425          *  
    426          * @param gridSchedulingPluginName 
    427          * @param forecastFinishTimePluginName 
    428          * @param localAllocPolicyPluginName 
    429          * @param resdescFileName 
    430          * @param taskParamFileName 
    431          * @param outputFolder 
    432          * @param outputWorkloadFileName 
    433          * @param overwriteFiles 
    434          * @param printHistory 
    435          */ 
    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 mode 
    451                 this.createScenario = true; 
    452         } 
    453  
    454         /** 
    455          * Creates a new configuration object in the READ_SCENARIO mode. 
    456          *  
    457          * @param gridSchedulingPluginName 
    458          * @param forecastFinishTimePluginName 
    459          * @param localAllocPolicyPluginName 
    460          * @param resdescFileName 
    461          * @param inputFolder 
    462          * @param inputWorkloadFileName 
    463          * @param overwriteFiles 
    464          * @param printHistory 
    465          */ 
    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 mode 
    479                 this.createScenario = false; 
    480365        } 
    481366 
Note: See TracChangeset for help on using the changeset viewer.