Package pec

Examples of pec.PEC


      //e.printStackTrace();
      return;
    }
    /*Create a new PriorityQueue-PEC and fill it with a new
     *Mevent for each ant in the ant colony*/
    PEC pec = new PQPEC();
    for(int i=0;i<antColSize;i++){
      event = new Mevent(new Float(0), graph);
      pec.addEvent(event);
    }
   
    /*Create the observation Event and put it in the PEC*/
    event = new Observation();
    pec.addEvent(event);
   
    /*PEC event retrieval cycle*/
    while((event = pec.getEvent())!=null){
      try{//Simulate
        newEventList = (LinkedList<ACOEvent>)event.processEvent();
      }catch (FinishException finish){//If the Event processing throws a finish Exception
        //System.out.println("Simulation finished: "+finish.getMessage());
        return;//End of Simulation
      }catch (InvalidGraphException invg){
        System.out.println("Bad Graph Design Error: " + invg.getMessage());
        return;
      }catch (Exception e){//If the Event processing throws any other exception
        System.out.println("Unexpected Error: " + e.getMessage());
        //e.printStackTrace();
        return;
      }
      while(!newEventList.isEmpty())//Add new generated Events to the PEC
        pec.addEvent(newEventList.removeFirst());
    }
   
    return;
  }
View Full Code Here

TOP

Related Classes of pec.PEC

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.