- Timestamp:
- 03/04/13 08:25:34 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/branches/coolemall/src/dcworms/schedframe/scheduling/Executable.java
r885 r896 25 25 import schedframe.scheduling.tasks.AbstractProcessesGroup; 26 26 import schedframe.scheduling.tasks.Task; 27 import schedframe.scheduling.tasks.phases.ResourceConsumption; 27 28 import schedframe.scheduling.tasks.phases.ResourceConsumptionProfile; 28 29 import schedframe.scheduling.tasks.requirements.ResourceParameterName; … … 39 40 40 41 protected int status; 41 protected double length;42 42 protected Map<ResourceParameterName, Object> specificResources; 43 43 … … 158 158 } 159 159 160 if (newStatus < DCWormsTags.CREATED || newStatus > DCWormsTags. FAILED_RESOURCE_UNAVAILABLE) {160 if (newStatus < DCWormsTags.CREATED || newStatus > DCWormsTags.NEW_EXEC_PHASE) { 161 161 throw new Exception("Executable.setStatuts() : Error - " + 162 162 "Invalid integer range for Execiutable status."); … … 204 204 } 205 205 } 206 207 if(status == DCWormsTags.NEW_EXEC_PHASE){ 208 if(prevStatus == DCWormsTags.INEXEC){ 209 status = DCWormsTags.INEXEC; 210 setCompletionPercentage(0); 211 task.getResourceConsumptionProfile().setCurrentPhase(task.getResourceConsumptionProfile().getCurrentPhase() + 1); 212 213 DateTime currentDateTime = new DateTime(); 214 215 if(getUsedResources().getLast().getTimeStamp().getMillis() == currentDateTime.getMillis()){ 216 return; 217 } 218 ResourceHistoryItem resHistItem = new ResourceHistoryItem(getUsedResources().getLast().getResourceUnits(), currentDateTime); 219 addUsedResources(resHistItem); 220 } 221 } 206 222 } 207 223 … … 209 225 if(this.specificResources == null) 210 226 this.specificResources = new HashMap<ResourceParameterName, Object>(); 211 212 227 this.specificResources.put(resourceName, value); 213 228 } … … 216 231 if(this.specificResources == null) 217 232 return false; 218 219 233 return this.specificResources.containsKey(resourceName); 220 234 } … … 255 269 } 256 270 257 public void setSchedulerName(int resourceId) 258 { 271 public void setSchedulerName(int resourceId){ 259 272 this.schedName = GridSim.getEntityName(resourceId); 260 273 } 261 274 262 public String getSchedulerName() 263 { 275 public String getSchedulerName(){ 264 276 return schedName; 265 277 } … … 368 380 } 369 381 370 private int currentPhase = 0; 371 372 public int getCurrentPhase() { 373 return currentPhase; 374 } 375 376 public void setCurrentPhase(int currentPhase) { 377 this.currentPhase = currentPhase; 382 public ResourceConsumption getCurrentResourceConsumption(){ 383 return task.getResourceConsumptionProfile().getCurrentResourceConsumption(); 378 384 } 379 385
Note: See TracChangeset
for help on using the changeset viewer.