Ignore:
Timestamp:
03/19/14 18:22:27 (11 years ago)
Author:
wojtekp
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • DCWoRMS/branches/coolemall/src/simulator/DCWormsUsers.java

    r1207 r1299  
    7474                sendJobsIds = new HashSet<String>(); 
    7575                returnedJobsIds = new HashSet<String>(); 
    76                  
     76                returnedJobs = new ArrayList<JobInterface<?>>(); 
    7777                this.xsltTransformer = new XsltTransformations(); 
    7878        } 
     
    8080        @Override 
    8181        public void body() { 
    82                 sendJobs(); 
    83                 collectJobs(); 
     82                if(workloadLoader != null){ 
     83                        sendJobs(); 
     84                        collectJobs();   
     85                } else { 
     86                        submissionStartTime = 0; 
     87                } 
    8488 
    8589                //GridSim dependent code for shutting down the simulation 
     
    9397         */ 
    9498        protected void collectJobs() { 
    95                 final int FACTOR = Math.min(10, workloadLoader.getTaskCount()); //the refresh rate of the gauge: at most 10 times 
     99                final int FACTOR = Math.min(100, workloadLoader.getTaskCount() > 0 ? workloadLoader.getTaskCount() : 1); //the refresh rate of the gauge: at most 10 times 
    96100                final int denominator = workloadLoader.getTaskCount() / FACTOR; 
    97101                allTasksAreFinished = true; 
    98                 returnedJobs = new ArrayList<JobInterface<?>>(); 
    99102                int counter = 0; 
    100103                int oldRemeinder = 0; 
     
    244247         
    245248        public List<JobDescription> getAllSentJobs() { 
     249                if (workloadLoader == null) 
     250                        return new ArrayList<JobDescription>(); 
    246251                return (List<JobDescription>) workloadLoader.getJobs(); 
    247252        } 
     
    349354         
    350355        public boolean isSimStartTimeDefined(){ 
     356                if(workloadLoader == null){ 
     357                        return false; 
     358                } 
    351359                return workloadLoader.isSimStartTimeDefined(); 
    352360        } 
Note: See TracChangeset for help on using the changeset viewer.