Package jmt.engine.QueueNet

Examples of jmt.engine.QueueNet.JobClassList


   * the representation at engine level
   */
  public void initialize() {
    QueueNetwork net = dispatcher.getSimulation().getNetwork();
    NodeList nodeList = net.getNodes();
    JobClassList classList = net.getJobClasses();
    TreeMap<String, Object> tm = new TreeMap<String, Object>();
    //a TreeMap is used to speedup the following code
    for (int j = 0; j < servers.size(); j++) {
      Object thisKey = servers.get(j);
      String thisName = mediator.getStationDefinition().getStationName(thisKey);
      tm.put(thisName, thisKey);
    }
    //performs the server mapping
    for (int i = 0; i < nodeList.size(); i++) {
      NetNode temp = nodeList.get(i);
      NodeSection serviceSection = null;
      try {
        serviceSection = temp.getSection(NodeSection.SERVICE);
      } catch (NetException ne) {
      }
      if (serviceSection instanceof Server || serviceSection instanceof PSServer) {
        serverMap.put(tm.get(temp.getName()), temp);
      }
    }
    tm.clear();
    //performs the class mapping
    for (int j = 0; j < classes.size(); j++) {
      Object thisKey = classes.get(j);
      String thisName = mediator.getClassDefinition().getClassName(thisKey);
      tm.put(thisName, thisKey);
    }
    for (int i = 0; i < classList.size(); i++) {
      JobClass temp = classList.get(i);
      classMap.put(tm.get(temp.getName()), temp);
    }
    //set the initialized state
    initialized = true;
  }
View Full Code Here


    }

    RandomEngine randomEng = RandomEngine.makeDefault();
    int randomClassIndex;

    JobClassList jobClasses = getJobClasses();

    while (totJobs > 0) {
      //jobs of different classes must be mixed.. use random numbers

      randomClassIndex = (int) Math.floor((randomEng.raw()) * classNumber);

      if (residualClassJobs[randomClassIndex] > 0) {
        //other jobs to be added
        Job newJob = new Job(jobClasses.get(randomClassIndex));
        JobInfo newJobInfo = new JobInfo(newJob);
       
        // Signals to node jobInfoList otherwise measures and Load dependent code are wrong
        this.getOwnerNode().getJobInfoList().add(newJobInfo);
        // Adds this job to the queue jobinfolist
View Full Code Here

TOP

Related Classes of jmt.engine.QueueNet.JobClassList

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.