Changeset 1423 for DCWoRMS/branches


Ignore:
Timestamp:
07/30/14 12:25:00 (11 years ago)
Author:
wojtekp
Message:
 
Location:
DCWoRMS/branches/coolemall/src
Files:
1 added
34 edited

Legend:

Unmodified
Added
Removed
  • DCWoRMS/branches/coolemall/src/dcworms/schedframe/scheduling/Executable.java

    r1415 r1423  
    5151         
    5252        protected int estimatedDuration; 
    53         protected String schedName; 
     53        protected String schedulerName; 
    5454 
    5555        protected double submissionTime; 
     
    157157        } 
    158158         
    159         public boolean isFinished() 
    160     { 
     159        public boolean isFinished(){ 
    161160                return task.isFinished(); 
    162161    } 
     
    264263 
    265264    public void setSchedulerName(int resourceId){ 
    266         this.schedName = GridSim.getEntityName(resourceId); 
     265        this.schedulerName = GridSim.getEntityName(resourceId); 
    267266    } 
    268267     
    269268    public void setSchedulerName(String resourceId){ 
    270         this.schedName = resourceId; 
     269        this.schedulerName = resourceId; 
    271270    } 
    272271 
    273272    public String getSchedulerName(){ 
    274         return schedName; 
     273        return schedulerName; 
    275274    } 
    276275         
     
    375374         
    376375        private void preparePhases(String resourceType) { 
    377                 LinkedList<ExecutionPhase> resourceConsumptionList = new LinkedList<ExecutionPhase>(); 
     376                LinkedList<ExecutionPhase> execPhases = new LinkedList<ExecutionPhase>(); 
    378377                 
    379378                long usefulWork = -1; 
     
    388387                                e.printStackTrace(); 
    389388                        } 
    390                         resourceConsumptionList.add(resConsumption); 
     389                        execPhases.add(resConsumption); 
    391390                } else { 
    392391                        boolean found = false; 
     
    396395                                                for(ResourceConsumptionType resConsumption: resConsumptioProfile.getResourceConsumption()){ 
    397396                                                        ExecutionPhase resourceConsumption = new ExecutionPhase(resConsumption); 
    398                                                         resourceConsumptionList.add(resourceConsumption); 
     397                                                        execPhases.add(resourceConsumption); 
    399398                                                } 
    400399                                                for(StringParameterType prop: resConsumptioProfile.getProperties()){ 
     
    412411                                for(ResourceConsumptionType resConsumption: task.getDescription().getExecution().getResourceConsumptionProfile()[0].getResourceConsumption()){ 
    413412                                        ExecutionPhase resourceConsumption = new ExecutionPhase(resConsumption); 
    414                                         resourceConsumptionList.add(resourceConsumption); 
     413                                        execPhases.add(resourceConsumption); 
    415414                                } 
    416415                                 
     
    425424                 
    426425                usefulWork = (usefulWork != -1) ? usefulWork : this.getLength(); 
    427                 this.execProfile = new ExecutionProfile(resourceConsumptionList); 
     426                this.execProfile = new ExecutionProfile(execPhases); 
    428427                this.execProfile.setUsefulWork(usefulWork); 
    429428 
  • DCWoRMS/branches/coolemall/src/example/load/ProcessorLoadEstimationPlugin.java

    r1415 r1423  
    11package example.load; 
    22 
     3import schedframe.resources.ResourceStatus; 
     4import schedframe.resources.computing.Core; 
    35import schedframe.resources.computing.Processor; 
    46import schedframe.resources.computing.profiles.energy.ResourceEvent; 
    57import schedframe.resources.devices.PhysicalResource; 
    68import schedframe.scheduling.manager.tasks.JobRegistry; 
    7 import schedframe.scheduling.manager.tasks.JobRegistryImpl; 
    8 import schedframe.scheduling.tasks.phases.PhaseSystemLoad; 
    9 import dcworms.schedframe.scheduling.ExecTask; 
    109 
    1110public class ProcessorLoadEstimationPlugin extends BaseLoadEstimationPlugin{ 
     
    1413                Processor proc = (Processor) resource; 
    1514                double sumCoresLoad = 0; 
    16                  
    17                 double nrOfThreadsOnCpu = proc.getCores().size(); 
    18                  
    19                 if(proc.getResourceCharacteristic().getParameters().get("threads") != null){ 
    20                         nrOfThreadsOnCpu = nrOfThreadsOnCpu * Integer.valueOf(proc.getResourceCharacteristic().getParameters().get("threads").get(0).getContent()).intValue(); 
     15                if(proc.getStatus().equals(ResourceStatus.BUSY)){ 
     16                        sumCoresLoad = 1; 
     17                } else { 
     18                        if(proc.getCores().size() > 0){ 
     19                                for(Core core: proc.getCores()){ 
     20                                        if(core.getStatus().equals(ResourceStatus.BUSY)){ 
     21                                                sumCoresLoad = sumCoresLoad + 1; 
     22                                        } 
     23                                } 
     24                                sumCoresLoad = sumCoresLoad / proc.getCores().size();    
     25                        } 
    2126                } 
    22  
    23  
    24                 JobRegistry jr = new JobRegistryImpl(proc.getFullName()); 
    25                 for(ExecTask task: jr.getRunningTasks()){ 
    26                         double cpuUsage = 1 / nrOfThreadsOnCpu; 
    27  
    28                         for(PhaseSystemLoad pb: task.getExecutionProfile().getCurrentResourceConsumption().getSystemLoad()){ 
    29                                 if(pb.getResouceName().equals("PM_CPU_Usage")){ 
    30                                         cpuUsage = pb.getUtilization(); 
    31                                 } 
    32                         } 
    33                         sumCoresLoad = sumCoresLoad + cpuUsage; 
    34  
    35                 } 
    36  
    3727 
    3828                double processorLoad = 100 * sumCoresLoad;       
  • DCWoRMS/branches/coolemall/src/example/timeestimation/coolemall/PhaseBasedTimeEstimationPlugin.java

    r1415 r1423  
    5858                int cnt = peUnit.getUsedAmount(); 
    5959 
    60                 double execTime = (1 - completionPercentage/100) * task.getExecutionProfile().getCurrentResourceConsumption().getLenght() / (speed * cnt); 
     60                double execTime = (1 - completionPercentage/100) * task.getExecutionProfile().getCurrentExecutionPhase().getLenght() / (speed * cnt); 
    6161 
    6262                //double execTime = (1 - completionPercentage/100) * task.getExecutionProfile().getCurrentResourceConsumption().getDuration() * (taskFreq / currentFrequency); 
  • DCWoRMS/branches/coolemall/src/schedframe/Parameters.java

    r477 r1423  
    1010        private static final long serialVersionUID = 1L; 
    1111         
     12        public Parameters(int initSize){ 
     13                super(initSize); 
     14        } 
    1215} 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/ResourceStatus.java

    r477 r1423  
    44        BUSY, 
    55        FREE, 
    6         RESERVED, 
    76        FAILED, 
    87        PENDING, 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ComputingResource.java

    r1415 r1423  
    4747        //protected ResourceCharacteristics resourceCharacteristic; 
    4848 
    49  
     49         
    5050        public ComputingResource(ComputingResourceDescription resDesc) { 
    5151                this.type = resDesc.getType(); 
     
    5353                this.category = resDesc.getCategory(); 
    5454                this.status = ResourceStatus.FREE; 
    55                 this.extensionList = new ExtensionListImpl(1); 
     55                this.extensionList = new ExtensionListImpl(2); 
    5656                initCharacteristics(resDesc); 
    5757                accept(new LoadExtension(resDesc.getLoadProfile(), this)); 
    5858                accept(new EnergyExtension.Builder().resource(this).powerProfile(resDesc.getPowerProfile()).airflowProfile(resDesc.getAirflowProfile()).thermalProfile(resDesc.getThermalProfile()).build());    
     59 
    5960        } 
    6061 
    6162        protected void initCharacteristics(ComputingResourceDescription resDesc){ 
    62                 resourceCharacteristic = ComputingResourceCharacteristics.builder().resourceUnits(resDesc.getResourceUnits()).location(resDesc.getLocation()).parameters(resDesc.getParameters()).device(resDesc.getDevices()).build(); 
     63                this.resourceCharacteristic = ComputingResourceCharacteristics.builder().resourceUnits(resDesc.getResourceUnits()).location(resDesc.getLocation()).parameters(resDesc.getParameters()).device(resDesc.getDevices()).build(); 
    6364                for(Device device: ((ComputingResourceCharacteristics)resourceCharacteristic).getDevices()){ 
    6465                        device.setComputingResource(this); 
     
    7172 
    7273        public void setParent(ComputingResource newParent) { 
    73                 parent = newParent; 
     74                this.parent = newParent; 
    7475                /*if(this.getLoadInterface().getLoadCalendar().getLoadDistribution().size() == 0){ 
    7576                        this.getLoadInterface().getLoadCalendar().getLoadDistribution().addAll(parent.getLoadInterface().getLoadCalendar().getLoadDistribution()); 
     
    7980        public List<ComputingResource> getChildren() { 
    8081                if (children == null) 
    81                         return new ArrayList<ComputingResource>(1); 
     82                        return new ArrayList<ComputingResource>(0); 
    8283                return children; 
    8384        } 
     
    124125                ResourceEventCommand rec = new ResourceEventCommand(this); 
    125126                rec.execute(event); 
    126                 SchedulingEventCommand sec = new SchedulingEventCommand(this); 
    127                 sec.execute(event); 
    128  
     127                if((scheduler != null && (parent != null && scheduler != parent.getScheduler()))  && !event.getSource().equals(scheduler.getFullName())){ 
     128                        SchedulingEventCommand sec = new SchedulingEventCommand(this); 
     129                        sec.execute(event); 
     130                } 
    129131                //old, correctly working method 
    130132                /*if (extensionList != null) { 
     
    143145        } 
    144146         
     147 
     148        public void updateState(ResourceEvent event){ 
     149                for (Device device: ((ComputingResourceCharacteristics)resourceCharacteristic).getDevices()) { 
     150                        for (Extension extension: device.getExtensionList()) { 
     151                                if (extension.supportsEvent(event)) { 
     152                                        extension.handleEvent(event); 
     153                                } 
     154                        } 
     155                } 
     156                 
     157                if (extensionList != null) { 
     158                        for (Extension extension: extensionList) { 
     159                                if (extension.supportsEvent(event)) { 
     160                                        extension.handleEvent(event); 
     161                                } 
     162                        } 
     163                } 
     164                 
     165        } 
     166         
    145167        public List <? extends ComputingResource> getDescendantsByType(ResourceType type) { 
    146                 List<ResourceValidator> validators = new ArrayList<ResourceValidator>(); 
     168                List<ResourceValidator> validators = new ArrayList<ResourceValidator>(1); 
    147169                validators.add(new ResourceTypeValidator(type)); 
    148170                return searchDescendants(validators, true); 
     
    150172 
    151173        public List<? extends ComputingResource> getDescendantsByTypeAndStatus(ResourceType type, ResourceStatus status) { 
    152                 List<ResourceValidator> validators = new ArrayList<ResourceValidator>(); 
     174                List<ResourceValidator> validators = new ArrayList<ResourceValidator>(2); 
    153175                validators.add(new ResourceStatusValidator(status)); 
    154176                validators.add(new ResourceTypeValidator(type)); 
     
    157179 
    158180        public ComputingResource getDescendantByName(String resourceName){ 
    159                 List<ResourceValidator> validators = new ArrayList<ResourceValidator>(); 
     181                List<ResourceValidator> validators = new ArrayList<ResourceValidator>(1); 
    160182                validators.add(new ResourceNameValidator(resourceName)); 
    161183                List<? extends ComputingResource> resources = searchDescendants(validators, true); 
     
    227249                 
    228250                public void handleResourceEvent(ResourceEvent event){ 
     251                        for (Device device: ((ComputingResourceCharacteristics)resourceCharacteristic).getDevices()) { 
     252                                for (Extension extension: device.getExtensionList()) { 
     253                                        if (extension.supportsEvent(event)) { 
     254                                                extension.handleEvent(event); 
     255                                        } 
     256                                } 
     257                        } 
     258                         
    229259                        if (extensionList != null) { 
    230260                                for (Extension extension: extensionList) { 
    231261                                        if (extension.supportsEvent(event)) { 
    232262                                                extension.handleEvent(event); 
    233                                         } 
    234                                 } 
    235                                  
    236                                 for (Device device: ((ComputingResourceCharacteristics)resourceCharacteristic).getDevices()) { 
    237                                         for (Extension extension: device.getExtensionList()) { 
    238                                                 if (extension.supportsEvent(event)) { 
    239                                                         extension.handleEvent(event); 
    240                                                 } 
    241263                                        } 
    242264                                } 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ComputingResourceCharacteristics.java

    r1207 r1423  
    2020                this.resUnits = builder.resUnits; 
    2121                this.devices = builder.devices; 
    22                 // TODO Auto-generated constructor stub 
    2322        } 
    2423 
    2524        public Map<ResourceUnitName, List<ResourceUnit>> getResourceUnits() { 
    2625                if(resUnits == null) 
    27                         return new HashMap<ResourceUnitName, List<ResourceUnit>>(); 
     26                        return new HashMap<ResourceUnitName, List<ResourceUnit>>(2); 
    2827                return resUnits; 
    2928        } 
     
    5453        public List<Device> getDevices(){ 
    5554                if(devices == null) 
    56                         return new ArrayList<Device>(); 
     55                        return new ArrayList<Device>(0); 
    5756                return devices; 
    5857        } 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ResourceCharacteristics.java

    r1207 r1423  
    3030        public Parameters getParameters() { 
    3131                if(parameters == null) 
    32                         return new Parameters(); 
     32                        return new Parameters(2); 
    3333                return parameters; 
    3434        } 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/description/ComputingResourceDescription.java

    r1344 r1423  
    112112        public void addResourceUnit(ResourceUnit unit) { 
    113113                if (this.resUnits == null) 
    114                         this.resUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>(1); 
     114                        this.resUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>(2); 
    115115                List<ResourceUnit> list = null; 
    116116                if (this.resUnits.containsKey(unit.getName())) { 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/EnergyExtension.java

    r1415 r1423  
    111111                if(powerProfile == null || powerProfile.getEnergyEstimationPlugin() == null) 
    112112                        return false; 
    113                 if(event.getType().getName().equals(ResourceEventType.POWER_STATE_CHANGED.getName())) 
     113                if(event.getType().getName().equals(ResourceEventType.UTILIZATION_CHANGED.getName())) 
     114                        return true; 
     115                else if(event.getType().getName().equals(ResourceEventType.TASK_STARTED.getName())) 
     116                        return true; 
     117                else if(event.getType().getName().equals(ResourceEventType.TASK_FINISHED.getName())) 
     118                        return true; 
     119                else if(event.getType().getName().equals(ResourceEventType.POWER_STATE_CHANGED.getName())) 
    114120                        return true; 
    115121                else if(event.getType().getName().equals(ResourceEventType.CPU_FREQUENCY_CHANGED.getName())) 
    116122                        return true; 
    117                 else if(event.getType().getName().equals(ResourceEventType.TASK_STARTED.getName())) 
    118                         return true; 
    119                 else if(event.getType().getName().equals(ResourceEventType.TASK_FINISHED.getName())) 
    120                         return true; 
    121                 else if(event.getType().getName().equals(ResourceEventType.UTILIZATION_CHANGED.getName())) 
     123                else if(event.getType().getName().equals(ResourceEventType.UPDATE_POWER_STATE.getName())) 
    122124                        return true; 
    123125         
     
    138140                        switch (resEvent.getType()) { 
    139141                         
    140                         case UPDATE_POWER_STATE: 
    141                                 PowerStateName newPowerState = (PowerStateName) resEvent.getData(); 
    142                                 powerInterface.setPowerState(newPowerState); 
    143                                 break; 
    144                                  
     142                        case UTILIZATION_CHANGED: 
     143                                power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(resEvent, new JobRegistryImpl(resource.getFullName()), resource); 
     144                                status = powerProfile.addToPowerUsageHistory(power); 
     145                                break; 
     146                                 
     147                        case TASK_STARTED: 
     148                                power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(resEvent, new JobRegistryImpl(resource.getFullName()), resource); 
     149                                status = powerProfile.addToPowerUsageHistory(power); 
     150                                break; 
     151         
     152                        case TASK_FINISHED: 
     153                                power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(resEvent, new JobRegistryImpl(resource.getFullName()), resource); 
     154                                status = powerProfile.addToPowerUsageHistory(power); 
     155                                break; 
     156                                                                 
    145157                        case POWER_STATE_CHANGED: 
    146158                                power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(resEvent, new JobRegistryImpl(resource.getFullName()), resource);                      
     
    153165                                break; 
    154166                                 
    155                         case TASK_STARTED: 
    156                                 power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(resEvent, new JobRegistryImpl(resource.getFullName()), resource); 
    157                                 status = powerProfile.addToPowerUsageHistory(power); 
    158                                 break; 
    159          
    160                         case TASK_FINISHED: 
    161                                 power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(resEvent, new JobRegistryImpl(resource.getFullName()), resource); 
    162                                 status = powerProfile.addToPowerUsageHistory(power); 
    163                                 break; 
    164                                  
    165                         case UTILIZATION_CHANGED: 
    166                                 power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(resEvent, new JobRegistryImpl(resource.getFullName()), resource); 
    167                                 status = powerProfile.addToPowerUsageHistory(power); 
     167                        case UPDATE_POWER_STATE: 
     168                                if(resource.getFullName().equals(resEvent.getSource())){ 
     169                                        PowerStateName newPowerState = (PowerStateName) resEvent.getData(); 
     170                                        powerInterface.setPowerState(newPowerState); 
     171                                } 
    168172                                break; 
    169173                                 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/AirflowInterface.java

    r1396 r1423  
    2424        public AirflowValue getRecentAirflow(); 
    2525         
    26         List<AirflowValue> getAirflowHistory(); 
     26        public List<AirflowValue> getAirflowHistory(); 
    2727         
    2828        public Parameters getParameters(); 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/ComputingResourceAirflowInterface.java

    r1415 r1423  
    11package schedframe.resources.computing.profiles.energy.airthroughput.ui; 
    22 
    3 import java.util.ArrayList; 
    43import java.util.List; 
    54 
     
    5453 
    5554        public List<AirflowState> getSupportedAirflowStates() { 
    56                 List<AirflowState> airflowStates = new ArrayList<AirflowState>(); 
    57                 for(AirflowState airflowState: airflowProfile.getAirflowStates()){ 
    58                         airflowStates.add(airflowState); 
    59                 } 
    60                 return airflowStates; 
     55                return airflowProfile.getAirflowStates(); 
    6156        } 
    6257 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PowerProfile.java

    r1207 r1423  
    6464        public List<PowerState> getSupportedPowerStates() { 
    6565                if(supportedPowerStates == null) 
    66                         return new ArrayList<PowerState>(); 
     66                        return new ArrayList<PowerState>(0); 
    6767                return supportedPowerStates; 
    6868        } 
     
    7070        public Map<String, PState> getSupportedPStates() { 
    7171                if(supportedPStates == null) 
    72                         return new HashMap<String, PState>(); 
     72                        return new HashMap<String, PState>(0); 
    7373                return supportedPStates; 
    7474        } 
     
    117117                boolean supportsOFF = false; 
    118118                if(supportedPowerStates == null){ 
    119                         supportedPowerStates = new ArrayList<PowerState>(); 
     119                        supportedPowerStates = new ArrayList<PowerState>(4); 
    120120                } 
    121121                for(PowerState ps: supportedPowerStates){ 
     
    128128                 
    129129                if(!supportsON){ 
    130                         supportedPowerStates.add(new PowerState(StandardPowerStateName.ON, -1, new ArrayList<Transition>())); 
     130                        supportedPowerStates.add(new PowerState(StandardPowerStateName.ON, -1, null)); 
     131                        supportedPowerStates.add(new PowerState(StandardPowerStateName.BOOT, -1, null)); 
    131132                } 
    132133                if(!supportsOFF){ 
    133                         supportedPowerStates.add(new PowerState(StandardPowerStateName.OFF, -1, new ArrayList<Transition>())); 
     134                        supportedPowerStates.add(new PowerState(StandardPowerStateName.OFF, -1, null)); 
     135                        supportedPowerStates.add(new PowerState(StandardPowerStateName.POWEROFF, -1, null)); 
    134136                } 
    135137        } 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PowerState.java

    r477 r1423  
    11package schedframe.resources.computing.profiles.energy.power; 
    22 
     3import java.util.ArrayList; 
    34import java.util.List; 
    45 
     
    2425        } 
    2526        public List<Transition> getTransitions() { 
     27                if(transitions == null) 
     28                        return new ArrayList<Transition>(0); 
    2629                return transitions; 
    2730        } 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingResourcePowerInterface.java

    r1415 r1423  
    11package schedframe.resources.computing.profiles.energy.power.ui; 
    22 
    3 import java.util.ArrayList; 
    43import java.util.List; 
    54 
     
    6564 
    6665        public List<PowerState> getSupportedPowerStates(){ 
    67                 List<PowerState> powerStates = new ArrayList<PowerState>(); 
    68                 for(PowerState powerState: powerProfile.getSupportedPowerStates()){ 
    69                         powerStates.add(powerState); 
    70                 } 
    71                 return powerStates; 
     66                return powerProfile.getSupportedPowerStates(); 
    7267        } 
    7368 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/NodePowerInterface.java

    r1415 r1423  
    44 
    55import java.util.List; 
     6 
    67 
    78import schedframe.resources.ResourceStatus; 
     
    3738                        } 
    3839 
    39                         if(state == StandardPowerStateName.OFF){ 
     40                        if(state == StandardPowerStateName.OFF || state == StandardPowerStateName.POWEROFF){ 
    4041                                node.setStatus(ResourceStatus.UNAVAILABLE); 
    4142                        } 
    42                         else if(state == StandardPowerStateName.ON){ 
     43                        else if(state == StandardPowerStateName.ON || state == StandardPowerStateName.BOOT){ 
    4344                                node.setStatus(ResourceStatus.FREE); 
    4445                        } 
     
    5556                /*double timePenalty = getTransitionTime(currentPowerState, StandardPowerStateName.ON); 
    5657                setPowerState(StandardPowerStateName.BOOT); 
    57                 DataCenterWorkloadSimulator.getEventManager().sendToResource(resource.getFullName(), timePenalty, new ResourceEvent(ResourceEventType.UPDATE_POWER_STATE, StandardPowerStateName.ON, resource.getFullName()));*/ 
     58                DataCenterWorkloadSimulator.getEventManager().sendToResource(resource.getFullName(), timePenalty, new ResourceEvent(ResourceEventType.UPDATE_POWER_STATE, StandardPowerStateName.ON, resource.getFullName())); 
     59                 */              
    5860                setPowerState(StandardPowerStateName.ON); 
    5961        } 
     
    6870        private double getTransitionTime(PowerStateName from, PowerStateName to){ 
    6971                List<PowerState> availablePowerStates = getSupportedPowerStates(); 
    70                 double timePenalty = 0; 
     72                double time = 0; 
    7173                for(PowerState ps : availablePowerStates){ 
    7274                        if(ps.getName().getLabel().equals(from.getLabel())){ 
     
    7476                                for(Transition t: transitions){ 
    7577                                        if(t.getTo().getLabel().equals(to)){ 
    76                                                 timePenalty = t.getTime(); 
     78                                                time = t.getTime(); 
    7779                                        } 
    7880                                } 
    7981                        } 
    8082                } 
    81                 return timePenalty; 
     83                return time; 
    8284        } 
    8385 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/PowerInterface.java

    r1380 r1423  
    2424        //public double getCurrentPowerConsumption(); 
    2525         
    26         List<PowerUsage> getPowerUsageHistory(); 
     26        public List<PowerUsage> getPowerUsageHistory(); 
    2727         
    2828        public Parameters getParameters(); 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/thermal/ui/ThermalInterface.java

    r804 r1423  
    1010        public TemperatureValue getRecentTemperature(); 
    1111         
    12         List<TemperatureValue> getTemperatureHistory(); 
     12        public List<TemperatureValue> getTemperatureHistory(); 
    1313         
    1414        public Parameters getParameters(); 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/load/LoadEstimationPluginFactory.java

    r1293 r1423  
    11package schedframe.resources.computing.profiles.load; 
    22 
     3import example.load.AppBasedProcessorLoadEstimationPlugin; 
    34import example.load.DefaultLoadEstimationPlugin; 
    45import example.load.ProcessorLoadEstimationPlugin; 
     
    1415                 
    1516                if(resType.getName().equals(StandardResourceType.Processor.getName())) 
    16                         loadEstimationPlugin = new ProcessorLoadEstimationPlugin(); 
     17                        loadEstimationPlugin = new AppBasedProcessorLoadEstimationPlugin(); 
    1718                else 
    1819                        loadEstimationPlugin = new DefaultLoadEstimationPlugin(); 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/load/LoadExtension.java

    r1415 r1423  
    1919        protected PhysicalResource resource; 
    2020 
    21         public LoadExtension(LoadProfile loadProfile,  PhysicalResource resource) { 
     21        public LoadExtension(LoadProfile loadProfile, PhysicalResource resource) { 
    2222                this.loadProfile = loadProfile; 
    2323                this.loadInterface =  LoadInterfaceFactory.createLoadInterface(resource, loadProfile); 
     
    2929                if(loadProfile == null || loadProfile.getLoadEstimationPlugin() == null) 
    3030                        return false; 
    31                 if(event.getType().getName().equals(ResourceEventType.POWER_STATE_CHANGED.getName())) 
    32                         return true; 
    33                 else if(event.getType().getName().equals(ResourceEventType.CPU_FREQUENCY_CHANGED.getName())) 
     31                if(event.getType().getName().equals(ResourceEventType.UTILIZATION_CHANGED.getName())) 
    3432                        return true; 
    3533                else if(event.getType().getName().equals(ResourceEventType.TASK_STARTED.getName())) 
     
    3735                else if(event.getType().getName().equals(ResourceEventType.TASK_FINISHED.getName())) 
    3836                        return true; 
    39                 else if(event.getType().getName().equals(ResourceEventType.UTILIZATION_CHANGED.getName())) 
    40                         return true;             
     37                else if(event.getType().getName().equals(ResourceEventType.POWER_STATE_CHANGED.getName())) 
     38                        return true; 
     39                else if(event.getType().getName().equals(ResourceEventType.CPU_FREQUENCY_CHANGED.getName())) 
     40                        return true; 
    4141                else return false; 
    4242        } 
     
    4444        public void handleEvent(Event event) { 
    4545                 
    46                 ResourceEvent enEvent = (ResourceEvent)event; 
     46                ResourceEvent resEvent = (ResourceEvent)event; 
    4747                double load = 0; 
    4848                try{ 
    49                         switch (enEvent.getType()) { 
     49                        switch (resEvent.getType()) { 
    5050                         
     51                        case UTILIZATION_CHANGED: 
     52                                load = loadProfile.getLoadEstimationPlugin().estimateUtlization(resEvent, new JobRegistryImpl(resource.getFullName()), resource); 
     53                                loadProfile.addToLoadHistory(load); 
     54                                break; 
     55                                 
     56                        case TASK_STARTED: 
     57                                load = loadProfile.getLoadEstimationPlugin().estimateUtlization(resEvent, new JobRegistryImpl(resource.getFullName()), resource); 
     58                                loadProfile.addToLoadHistory(load); 
     59                                break; 
     60         
     61                        case TASK_FINISHED: 
     62                                load = loadProfile.getLoadEstimationPlugin().estimateUtlization(resEvent, new JobRegistryImpl(resource.getFullName()), resource); 
     63                                loadProfile.addToLoadHistory(load); 
     64                                break; 
     65                                 
    5166                        case POWER_STATE_CHANGED: 
    52                                 load = loadProfile.getLoadEstimationPlugin().estimateUtlization(enEvent, new JobRegistryImpl(resource.getFullName()), resource); 
     67                                load = loadProfile.getLoadEstimationPlugin().estimateUtlization(resEvent, new JobRegistryImpl(resource.getFullName()), resource); 
    5368                                loadProfile.addToLoadHistory(load); 
    5469                                break; 
    5570                                 
    5671                        case CPU_FREQUENCY_CHANGED: 
    57                                 load = loadProfile.getLoadEstimationPlugin().estimateUtlization(enEvent, new JobRegistryImpl(resource.getFullName()), resource); 
    58                                 loadProfile.addToLoadHistory(load); 
    59                                 break; 
    60                                  
    61                         case TASK_STARTED: 
    62                                 load = loadProfile.getLoadEstimationPlugin().estimateUtlization(enEvent, new JobRegistryImpl(resource.getFullName()), resource); 
    63                                 loadProfile.addToLoadHistory(load); 
    64                                 break; 
    65          
    66                         case TASK_FINISHED: 
    67                                 load = loadProfile.getLoadEstimationPlugin().estimateUtlization(enEvent, new JobRegistryImpl(resource.getFullName()), resource); 
    68                                 loadProfile.addToLoadHistory(load); 
    69                                 break; 
    70                                  
    71                         case UTILIZATION_CHANGED: 
    72                                 load = loadProfile.getLoadEstimationPlugin().estimateUtlization(enEvent, new JobRegistryImpl(resource.getFullName()), resource); 
     72                                load = loadProfile.getLoadEstimationPlugin().estimateUtlization(resEvent, new JobRegistryImpl(resource.getFullName()), resource); 
    7373                                loadProfile.addToLoadHistory(load); 
    7474                                break; 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/devices/DeviceAirflowInterface.java

    r1415 r1423  
    11package schedframe.resources.devices; 
    22 
    3 import java.util.ArrayList; 
    43import java.util.List; 
    54 
     
    5453 
    5554        public List<AirflowState> getSupportedAirflowStates(){ 
    56                 List<AirflowState> airflowStates = new ArrayList<AirflowState>(); 
    57                 for(AirflowState airFlowState: airflowProfile.getAirflowStates()){ 
    58                         airflowStates.add(airFlowState); 
    59                 } 
    60                 return airflowStates; 
     55                return airflowProfile.getAirflowStates(); 
    6156        } 
    6257 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/devices/DeviceResourceCharacteristics.java

    r1207 r1423  
    1010        } 
    1111 
    12  
    1312} 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/devices/PhysicalResource.java

    r1415 r1423  
    22 
    33import schedframe.Initializable; 
    4 import schedframe.events.Event; 
    54import schedframe.events.EventHandler; 
    65import schedframe.resources.Resource; 
     
    109import schedframe.resources.computing.extensions.Extension; 
    1110import schedframe.resources.computing.extensions.ExtensionList; 
     11import schedframe.resources.computing.extensions.ExtensionListImpl; 
    1212import schedframe.resources.computing.extensions.ExtensionType; 
    1313import schedframe.resources.computing.profiles.energy.EnergyExtension; 
     
    9999         
    100100        public ExtensionList getExtensionList() { 
     101                if(extensionList == null){ 
     102                        return new ExtensionListImpl(0); 
     103                } 
    101104                return extensionList; 
    102105        } 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/devices/description/PhysicalResourceDescription.java

    r1415 r1423  
    9191                                         
    9292                                        if(params == null) 
    93                                                 params = new Parameters(); 
     93                                                params = new Parameters(2); 
    9494                                        params.put("powerCapLevel", param); 
    9595                                } 
     
    102102                                         
    103103                                        if(params == null) 
    104                                                 params = new Parameters(); 
     104                                                params = new Parameters(2); 
    105105                                        params.put("powerFloorLevel", param); 
    106106                                } 
     
    273273                 
    274274                if(parameters.length != 0) 
    275                         params = new Parameters(); 
     275                        params = new Parameters(2); 
    276276                 
    277277                for(int i = 0; i < parameters.length; i++){ 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/units/ProcessingElements.java

    r1392 r1423  
    239239         
    240240        public ProcessingElements replicate(int amount){ 
    241                 List<ComputingResource> compResources =  new ArrayList<ComputingResource>(amount); 
     241                List<ComputingResource> compResources = new ArrayList<ComputingResource>(amount); 
    242242                Iterator<ComputingResource> it = resources.iterator(); 
    243243                amount = Math.min(resources.size(), amount); 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/ExecutionHistoryItem.java

    r1362 r1423  
    55public class ExecutionHistoryItem { 
    66 
    7         protected DateTime timeStamp; 
     7        protected long timeStamp; 
    88        protected double completionPercentage; 
    99        protected double estimatedDuration; 
     
    1111        protected int resUsageIndex; 
    1212 
    13         public ExecutionHistoryItem(DateTime time){ 
     13        public ExecutionHistoryItem(long time){ 
    1414                this.timeStamp = time; 
    1515        } 
    1616 
    17         public DateTime getTimeStamp(){ 
     17        public long getTimeStamp(){ 
    1818                return timeStamp; 
    1919        } 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/ResourceItem.java

    r1415 r1423  
    11package schedframe.scheduling; 
    22 
     3import java.util.HashSet; 
    34import java.util.LinkedList; 
    45import java.util.List; 
    56import java.util.Map; 
    67import java.util.Set; 
    7 import java.util.TreeSet; 
    88 
    99import schedframe.resources.computing.ComputingResource; 
     
    2020        public ResourceItem(Map<ResourceUnitName, ResourceUnit> usedResources){ 
    2121                this.usedResources = usedResources; 
    22                 this.resourceNames = new TreeSet<String>(); 
    23                 saveResourceNames(); 
     22                this.resourceNames = saveResourceNames(); 
    2423        } 
    2524         
     
    3231        } 
    3332         
    34         private void saveResourceNames(){ 
     33        private Set<String> saveResourceNames(){ 
     34                Set<String> resourceNames; 
    3535                ProcessingElements pes = (ProcessingElements) usedResources.get(StandardResourceUnitName.PE); 
    36                 for (ComputingResource resource : pes) { 
     36                resourceNames = new HashSet<String>(pes.size(), 1); 
     37                for (ComputingResource resource: pes) { 
    3738 
    3839                        LinkedList<ComputingResource> toExamine = new LinkedList<ComputingResource>(); 
     
    5455                        } 
    5556                } 
     57                return resourceNames; 
    5658        } 
    5759} 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/local/LocalManagementSystem.java

    r1415 r1423  
    44import java.util.HashMap; 
    55import java.util.Iterator; 
     6import java.util.LinkedHashSet; 
    67import java.util.List; 
    78import java.util.Map; 
     9import java.util.Set; 
    810 
    911import org.apache.commons.logging.Log; 
     
    9395 
    9496                int tag = ev.get_tag(); 
    95  
    9697                switch (tag) { 
    9798 
     
    139140                                getWorkloadUnitHandler().handleJob(job); 
    140141                        }  
    141                         //SUPPORTS PRECEDING CONSTRAINST COMING BOTH FROM SWF FILES 
     142                        //SUPPORTS PRECEDING CONSTRAINST COMING ALSO FROM SWF FILES 
    142143                        /*else { 
    143144                                try { 
     
    394395                PEUnit peUnit = (PEUnit)resources.get(StandardResourceUnitName.PE); 
    395396                updateComputingResources(peUnit, ResourceEventType.TASK_STARTED, exec); 
    396                  
    397         } 
     397        } 
     398 
    398399        protected void finalizeExecutable(ExecTask execTask){ 
    399400                 
     
    459460                        //System.out.println("taskId: " + exec.getId() + "; completion percentage: " + exec.getCompletionPercentage() + "; timespan: " + timeSpan + "; estimatedDuration: " +  execHistItem.getCompletionPercentage()); 
    460461                        exec.getExecutionProfile().setCompletionPercentage(exec.getExecutionProfile().getCompletionPercentage() + 100 * (timeSpan / (execHistItem.getEstimatedDuration()) * (1.0 - execHistItem.getCompletionPercentage()/100.0))); 
    461                         exec.setTotalCompletionPercentage(exec.getTotalCompletionPercentage() + 100 * (timeSpan / execHistItem.getEstimatedDuration()) * exec.getExecutionProfile().getCurrentResourceConsumption().getLenght() / exec.getExecutionProfile().getLength()); 
     462                        exec.setTotalCompletionPercentage(exec.getTotalCompletionPercentage() + 100 * (timeSpan / execHistItem.getEstimatedDuration()) * exec.getExecutionProfile().getCurrentExecutionPhase().getLenght() / exec.getExecutionProfile().getLength()); 
    462463                        //System.out.println("newProgress: " + exec.getCompletionPercentage()  );        
    463464 
     
    467468        private void updateComputingResources(PEUnit peUnit, ResourceEventType eventType, Object obj){ 
    468469                if(peUnit instanceof ProcessingElements){ 
    469                         ProcessingElements pes = (ProcessingElements) peUnit; 
     470                        /*ProcessingElements pes = (ProcessingElements) peUnit; 
    470471                        for (ComputingResource resource : pes) { 
    471472                                resource.handleEvent(new ResourceEvent(eventType, obj, scheduler.getFullName())); 
    472473                                //DataCenterWorkloadSimulator.getEventManager().sendToResources(resource.getType(), 0, new EnergyEvent(eventType, obj)); 
    473                         } 
     474                        }*/ 
    474475                        /*try { 
    475476                                for (ComputingResource resource : resourceManager.getResourcesOfType(pes.get(0).getType())) { 
     
    480481                                e.printStackTrace(); 
    481482                        }*/ 
     483                         
     484                        ProcessingElements pes = (ProcessingElements) peUnit; 
     485                        ResourceEvent resEvent = new ResourceEvent(eventType, obj, scheduler.getFullName());             
     486                        try{ 
     487                                Set<ComputingResource> resourcesToUpdate = new LinkedHashSet<ComputingResource>(); 
     488                         
     489                                for (ComputingResource compResource : pes) { 
     490                                        resourcesToUpdate.add(compResource); 
     491                                } 
     492                                while(resourcesToUpdate.size() > 0){ 
     493                                        Set<ComputingResource> newSet = new LinkedHashSet<ComputingResource>(); 
     494                                        for(ComputingResource compResource: resourcesToUpdate){ 
     495                                                compResource.updateState(resEvent); 
     496                                                if(compResource.getParent() != null){ 
     497                                                        newSet.add(compResource.getParent()); 
     498                                                } 
     499                                        } 
     500                                        resourcesToUpdate = new LinkedHashSet<ComputingResource>(newSet); 
     501                                } 
     502                        }catch(Exception e){ 
     503                        } 
    482504                } else { 
    483505                        ComputingResource resource = null; 
     
    492514 
    493515        protected void updateProcessingTimes() { 
    494                 for (ExecTask execTask : jobRegistry.getRunningTasks()) { 
     516                for (ExecTask execTask: jobRegistry.getRunningTasks()) { 
    495517                        Executable exec = (Executable)execTask; 
    496518 
     
    502524 
    503525                        ExecutionHistoryItem execHistItem = exec.getExecutionHistory().getLast(); 
    504                         double lastTimeStamp = execHistItem.getTimeStamp().getMillis() / 1000; 
     526                        double lastTimeStamp = execHistItem.getTimeStamp() / 1000; 
    505527                        if(DoubleMath.subtract((lastTimeStamp + execHistItem.getEstimatedDuration()), (new DateTime().getMillis() / 1000 + phaseDuration)) == 0.0){ 
    506528                                continue; 
     
    706728         
    707729        private void saveExecutionHistory(Executable exec, double completionPercentage, double estimatedDuration){ 
    708                 ExecutionHistoryItem execHistoryItem = new ExecutionHistoryItem(new DateTime()); 
     730                ExecutionHistoryItem execHistoryItem = new ExecutionHistoryItem(new DateTime().getMillis()); 
    709731                execHistoryItem.setCompletionPercentage(completionPercentage); 
    710732                execHistoryItem.setEstimatedDuration(estimatedDuration); 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/ExecutionProfile.java

    r1415 r1423  
    55public class ExecutionProfile { 
    66         
    7         protected LinkedList<ExecutionPhase> resourceConsumptionList; 
     7        protected LinkedList<ExecutionPhase> executionPhases; 
    88        protected long usefulWork; 
    99        protected double completionPercentage; 
     
    1111         
    1212 
    13         public ExecutionProfile(LinkedList<ExecutionPhase> resourceConsumptionList) { 
    14                 this.resourceConsumptionList = resourceConsumptionList; 
     13        public ExecutionProfile(LinkedList<ExecutionPhase> execPhases) { 
     14                this.executionPhases = execPhases; 
    1515                this.completionPercentage = 0; 
    1616                this.currentPhase = 0; 
    1717        } 
    1818         
    19         public LinkedList<ExecutionPhase> getResourceConsumptionList(){ 
    20                 return resourceConsumptionList; 
     19        public LinkedList<ExecutionPhase> getExecutionPhases(){ 
     20                return executionPhases; 
    2121        } 
    2222         
    23         public ExecutionPhase getCurrentResourceConsumption(){ 
    24                 return resourceConsumptionList.get(currentPhase); 
     23        public ExecutionPhase getCurrentExecutionPhase(){ 
     24                return executionPhases.get(currentPhase); 
    2525        } 
    2626 
     
    4242         
    4343        public boolean isLast(){ 
    44                 if(currentPhase == resourceConsumptionList.size() - 1){ 
     44                if(currentPhase == executionPhases.size() - 1){ 
    4545                        return true; 
    4646                } 
     
    5858        public long getLength() { 
    5959                long length = 0; 
    60                 for(ExecutionPhase execPhase: resourceConsumptionList){ 
     60                for(ExecutionPhase execPhase: executionPhases){ 
    6161                        length = length + execPhase.getLenght(); 
    6262                } 
  • DCWoRMS/branches/coolemall/src/simulator/ConfigurationOptions.java

    r1396 r1423  
    7777 
    7878         
    79         public static final String CREATESTATISTICS = "createstatistics"; 
    80         public static final String ACCUMULATED_RESOURCES_STATISTICS = CREATESTATISTICS + ".accumulatedresources"; 
    81         public static final String EXTENDED_TASKS_STATISTICS = CREATESTATISTICS + ".extendedtasks"; 
    82         public static final String JOBS_STATISTICS = CREATESTATISTICS + ".jobs"; 
    83         public static final String SIMULATION_STATISTICS = CREATESTATISTICS + ".simulation"; 
    84  
     79        public static final String CREATEXTSTATISTICS = "creatextatistics"; 
     80        public static final String ACCUMULATED_RESOURCES_STATISTICS = CREATEXTSTATISTICS + ".accumulatedresources"; 
     81        public static final String EXTENDED_TASKS_STATISTICS = CREATEXTSTATISTICS + ".extendedtasks"; 
     82        public static final String JOBS_STATISTICS = CREATEXTSTATISTICS + ".jobs"; 
     83        public static final String SIMULATION_STATISTICS = CREATEXTSTATISTICS + ".simulation"; 
     84        public static final String SIMULATION_UTILIZATION  = CREATEXTSTATISTICS + ".resutilization"; 
     85        public static final String SIMULATION_ENERGYUSAGE = CREATEXTSTATISTICS + ".respowerusage"; 
     86        public static final String SIMULATION_AIRFLOW = CREATEXTSTATISTICS + ".resairflow"; 
     87        public static final String SIMULATION_TEMPERATURE = CREATEXTSTATISTICS + ".restemperature"; 
     88         
     89         
    8590        public static final String PRESSURE_DROP = "pressuredrop"; 
    8691        public static final String OUTLET_ROOM_AIR_TEMPERATURE = "outletroomairtemperature"; 
     
    186191        public boolean createsimulationstatistics = true; 
    187192         
    188         public String [] resForEnergyChart; 
    189         public String [] resForAirflowChart; 
    190         public String [] resForTemperatureChart; 
    191         public String [] resForUtilizationChart; 
     193        public String [] compResForEnergyChart; 
     194        public String [] compResForAirflowChart; 
     195        public String [] compResForTemperatureChart; 
     196        public String [] compResForUtilizationChart; 
     197         
     198        public String [] compResForEnergyText; 
     199        public String [] compResForAirflowText; 
     200        public String [] compResForTemperatureText; 
     201        public String [] compResForUtilizationText; 
    192202         
    193203        public double pressureDrop; 
     
    311321 
    312322                try { 
    313                         co.resForUtilizationChart = bundle.getString(CREATEDIAGRAMS_UTILIZATION).split(";"); 
    314                         if(co.resForUtilizationChart.length > 0){ 
     323                        co.compResForUtilizationChart = bundle.getString(CREATEDIAGRAMS_UTILIZATION).split(";"); 
     324                        if(co.compResForUtilizationChart.length > 0){ 
    315325                                co.creatediagrams_resutilization = true; 
    316326                        } 
     
    325335                } 
    326336                try { 
    327                         co.resForEnergyChart = bundle.getString(CREATEDIAGRAMS_ENERGYUSAGE).split(";"); 
    328                         if(co.resForEnergyChart.length > 0){ 
     337                        co.compResForEnergyChart = bundle.getString(CREATEDIAGRAMS_ENERGYUSAGE).split(";"); 
     338                        if(co.compResForEnergyChart.length > 0){ 
    329339                                co.creatediagrams_respowerusage = true; 
    330340                        } 
     
    334344                 
    335345                try { 
    336                         co.resForAirflowChart = bundle.getString(CREATEDIAGRAMS_AIRFLOW).split(";"); 
    337                         if(co.resForAirflowChart.length > 0){ 
     346                        co.compResForAirflowChart = bundle.getString(CREATEDIAGRAMS_AIRFLOW).split(";"); 
     347                        if(co.compResForAirflowChart.length > 0){ 
    338348                                co.creatediagrams_resairflow = true; 
    339349                        } 
     
    343353                 
    344354                try { 
    345                         co.resForTemperatureChart = bundle.getString(CREATEDIAGRAMS_TEMPERATURE).split(";"); 
    346                         if(co.resForTemperatureChart.length > 0){ 
     355                        co.compResForTemperatureChart = bundle.getString(CREATEDIAGRAMS_TEMPERATURE).split(";"); 
     356                        if(co.compResForTemperatureChart.length > 0){ 
    347357                                co.creatediagrams_restemperature = true; 
    348358                        } 
    349359                } catch(MissingResourceException e){ 
    350360                        co.creatediagrams_restemperature = createDiagrams; 
     361                } 
     362                 
     363                try { 
     364                        co.compResForUtilizationText = bundle.getString(SIMULATION_UTILIZATION).split(";"); 
     365                } catch(MissingResourceException e){ 
     366                } 
     367                 
     368                try { 
     369                        co.compResForEnergyText = bundle.getString(SIMULATION_ENERGYUSAGE).split(";"); 
     370                } catch(MissingResourceException e){ 
     371                } 
     372                 
     373                try { 
     374                        co.compResForAirflowText = bundle.getString(SIMULATION_AIRFLOW).split(";"); 
     375                } catch(MissingResourceException e){ 
     376                } 
     377                 
     378                try { 
     379                        co.compResForTemperatureText = bundle.getString(SIMULATION_TEMPERATURE).split(";"); 
     380                } catch(MissingResourceException e){ 
    351381                } 
    352382                 
  • DCWoRMS/branches/coolemall/src/simulator/reader/EnvironmentWrapper.java

    r1207 r1423  
    9595                 
    9696                if(parameters.length != 0) 
    97                         params = new Parameters(); 
     97                        params = new Parameters(2); 
    9898                 
    9999                for(int i = 0; i < parameters.length; i++){ 
  • DCWoRMS/branches/coolemall/src/simulator/reader/ResourceReader.java

    r1396 r1423  
    326326                                 
    327327                                if(params == null) 
    328                                         params = new Parameters(); 
     328                                        params = new Parameters(2); 
    329329                                params.put("frequency", param); 
    330330                        } 
  • DCWoRMS/branches/coolemall/src/simulator/stats/implementation/DCWormsStatistics.java

    r1396 r1423  
    289289                for(String resourceTypeName: resourceController.getComputingResourceLayers()){ 
    290290                        List<Stats> cStats = new ArrayList<Stats>(); 
     291                        /*if(ArrayUtils.contains(configuration.compResForUtilizationText, resourceTypeName)) 
     292                                cStats.add(Stats.textLoad); 
     293                        if(ArrayUtils.contains(configuration.compResForEnergyText, resourceTypeName)) 
     294                                cStats.add(Stats.textEnergy); 
     295                        if(ArrayUtils.contains(configuration.compResForAirflowText, resourceTypeName)) 
     296                                cStats.add(Stats.textAirFlow); 
     297                        if(ArrayUtils.contains(configuration.compResForTemperatureText, resourceTypeName)) 
     298                                cStats.add(Stats.textTemperature);*/ 
    291299                        cStats.add(Stats.textLoad); 
    292                         if(ArrayUtils.contains(configuration.resForUtilizationChart, resourceTypeName)) 
     300                        if(ArrayUtils.contains(configuration.compResForUtilizationChart, resourceTypeName)) 
    293301                                cStats.add(Stats.chartLoad); 
    294302                        cStats.add(Stats.textEnergy); 
    295                         if(ArrayUtils.contains(configuration.resForEnergyChart, resourceTypeName)) 
     303                        if(ArrayUtils.contains(configuration.compResForEnergyChart, resourceTypeName)) 
    296304                                cStats.add(Stats.chartEnergy); 
    297305                        cStats.add(Stats.textAirFlow); 
    298                         if(ArrayUtils.contains(configuration.resForAirflowChart, resourceTypeName)) 
     306                        if(ArrayUtils.contains(configuration.compResForAirflowChart, resourceTypeName)) 
    299307                                cStats.add(Stats.chartAirFlow); 
    300308                        cStats.add(Stats.textTemperature); 
    301                         if(ArrayUtils.contains(configuration.resForTemperatureChart, resourceTypeName)) 
     309                        if(ArrayUtils.contains(configuration.compResForTemperatureChart, resourceTypeName)) 
    302310                                cStats.add(Stats.chartTemperature); 
    303311                        type_stats.put(resourceTypeName, cStats); 
    304312 
    305313                }                
    306                  
    307                 peGanttMap = new HashMap<String, TimetableEventSource>(); 
    308                 taskGanttMap = new HashMap<String, TimetableEventGroup>();               
    309                  
    310                 resourceOccupancyDiagrams = new HashMap<String, List<XYDataset>>(); 
    311                 resourceUtilizationDiagrams = new HashMap<String, List<XYDataset>>(); 
    312                 resourcePowerUsageDiagrams = new HashMap<String, List<XYDataset>>(); 
    313                 resourceAirFlowDiagrams = new HashMap<String, List<XYDataset>>(); 
    314                 resourceTemperatureDiagrams = new HashMap<String, List<XYDataset>>(); 
     314 
     315                resourceOccupancyDiagrams = new HashMap<String, List<XYDataset>>(2); 
     316                resourceUtilizationDiagrams = new HashMap<String, List<XYDataset>>(2); 
     317                resourcePowerUsageDiagrams = new HashMap<String, List<XYDataset>>(2); 
     318                resourceAirFlowDiagrams = new HashMap<String, List<XYDataset>>(2); 
     319                resourceTemperatureDiagrams = new HashMap<String, List<XYDataset>>(2); 
    315320                 
    316321                ganttDiagramTimetable = new Timetable(new FixedMillisecond( 
     
    536541                                                        } 
    537542                                                         
    538                                                         if(ArrayUtils.contains(configuration.resForEnergyChart, device.getType().getName())){ 
     543                                                        if(ArrayUtils.contains(configuration.compResForEnergyChart, device.getType().getName())){ 
    539544                                                                if (configuration.creatediagrams_respowerusage) { 
    540545                                                                        createResourceEnergyDiagramData(deviceEnergyUsage); 
     
    590595                                                        } 
    591596                                                         
    592                                                         if(ArrayUtils.contains(configuration.resForAirflowChart, device.getType().getName())){ 
     597                                                        if(ArrayUtils.contains(configuration.compResForAirflowChart, device.getType().getName())){ 
    593598                                                                if (configuration.creatediagrams_resairflow) { 
    594599                                                                        createResourceAirFlowDiagramData(deviceAirFlow); 
     
    645650                                                        } 
    646651                                                         
    647                                                         if(ArrayUtils.contains(configuration.resForTemperatureChart, device.getType().getName())){ 
     652                                                        if(ArrayUtils.contains(configuration.compResForTemperatureChart, device.getType().getName())){ 
    648653                                                                if (configuration.creatediagrams_restemperature) { 
    649654                                                                        createResourceTemperatureDiagramData(deviceTemperature); 
     
    847852                                        } 
    848853                                        if(st == -1){ 
    849                                                 st = execHistItem.getTimeStamp().getMillis(); 
     854                                                st = execHistItem.getTimeStamp(); 
    850855                                        } 
    851856                                                 
    852857                                        if(j < execHistory.size() - 1 && (execHistory.get(j + 1).getResIndex() != execHistItem.getResIndex() || execHistory.get(j + 1).getStatus() == DCWormsTags.PAUSED) || j + 1 == execHistory.size()){ 
    853858                                                if(j < execHistory.size() -1 && (execHistory.get(j + 1).getResIndex() != execHistItem.getResIndex() || execHistory.get(j + 1).getStatus() == DCWormsTags.PAUSED)) 
    854                                                         et = execHistory.get(j + 1).getTimeStamp().getMillis();  
     859                                                        et = execHistory.get(j + 1).getTimeStamp();  
    855860                                                else et = Double.valueOf(exec.getFinishTime()).longValue() * MILLI_SEC;  
    856861                                                if(resUnit instanceof ProcessingElements){ 
     
    922927                for(ExecutionHistoryItem execHistItem: execTask.getExecutionHistory()){ 
    923928                        if(previousStatus == DCWormsTags.INEXEC){ 
    924                                 executionTime = executionTime  + (execHistItem.getTimeStamp().getMillis()/1000 - previousTimestamp); 
     929                                executionTime = executionTime  + (execHistItem.getTimeStamp()/1000 - previousTimestamp); 
    925930                        }  
    926                         previousTimestamp  = execHistItem.getTimeStamp().getMillis()/1000; 
     931                        previousTimestamp  = execHistItem.getTimeStamp()/1000; 
    927932                        previousStatus = execHistItem.getStatus(); 
    928933                } 
     
    15201525         
    15211526        private void createPEGanttDiagram(Map<String,List<ResStat>> basicResStats) { 
     1527                peGanttMap = new HashMap<String, TimetableEventSource>(); 
     1528                taskGanttMap = new HashMap<String, TimetableEventGroup>(); 
    15221529                for(String peName: basicResStats.keySet()){ 
    15231530                        TimetableEventSource pe = new TimetableEventSource(peName); 
  • DCWoRMS/branches/coolemall/src/simulator/stats/implementation/TaskStats.java

    r1396 r1423  
    110110                for(ExecutionHistoryItem execHistItem: task.getExecutionHistory()){ 
    111111                        if(previousStatus == DCWormsTags.INEXEC){ 
    112                                 executionTime = executionTime  + (execHistItem.getTimeStamp().getMillis()/1000 - previousTimestamp); 
     112                                executionTime = executionTime  + (execHistItem.getTimeStamp()/1000 - previousTimestamp); 
    113113                        }  
    114                         previousTimestamp  = execHistItem.getTimeStamp().getMillis()/1000; 
     114                        previousTimestamp  = execHistItem.getTimeStamp()/1000; 
    115115                        previousStatus = execHistItem.getStatus(); 
    116116                } 
Note: See TracChangeset for help on using the changeset viewer.