CloudSim源码分析-CloudSim的初始化

来源:互联网 发布:linux切换图形界面命令 编辑:程序博客网 时间:2024/05/17 07:18
CloudSim.init(int numUser,Calender cal,boolean traceFlag)
一,initCommonVarible(cal,traceFlag,numUser)
      1,initialize()
          entities = new ArrayList<SimEntity>();//当所有实体启动startEntity()之后,用来存放所有实体的对象。
           entitiesByName = new LinkedHashMap<String, SimEntity>();//通过实体的名字取得相应的实体。
           future = new FutureQueue();//等待队列
           deferred = new DeferredQueue();//延时队列
           waitPredicates = new HashMap<Integer, Predicate>();
           clock = 0;
           running = false;
        2,CloudSimShutdown shutdown = new CloudSimShutdown("CloudSimShutdown", numUser);
              CloudSim.addEntity(this);
        3,shutdownId = shutdown.getId();
二,CloudInformationService cis = new CloudInformationService("CloudInformationService");
       CloudSim.addEntity(this);
       resList = new LinkedList<Integer>();//事先创建一个云资源列表,实质是用来存储所有数据中心的id
       arList = new LinkedList<Integer>();//
       gisList = new LinkedList<Integer>();//
三,cisId = cis.getId();
0 0
原创粉丝点击