From:
<ag...@ds...> - 2007-10-05 07:14:21
|
Good morning Yang Yu, Regarding the resource id, you should not change it, as it is Gridsim who decides the id for each entity in a simulation. If you really need to have a kind of id which you yourself can set, you can add a new parameter in the resource class (and call this new parameter, for example, my_id). This way you can use the my_id of resources (or any entity you want) to do all your stuff, whilst keeping the same GridSim's id (which is essential for GridSim to work). Regarding changing the speed of PEs, I'm sorry but I've not been able to look into it. All the best, Agustin yangyu escribió: > Good morning Agustin, > Good morning everyone, > > > Thank you very much for the information you gave to me. > I am happy to hear that the speed of PEs can be changed when the simulation > is running. > > I just tried one way to change the speed of PEs. It seems that it does not > work .(Forgive me if I chose a wrong way to write the code) I am not sure > the method I used is right or not. > Can you tell me why I can not change the speed(rating) of PEs when you are > not busy? > > Thank you very much. > > PS. I found that in the Class ResourceCharacteristics, the method > setResourceID(int id) does not work.(I can not make resources ID as I want > them to be.) > > (I am sorry that I sent this question to "GridSim-users] help regarding > compiling.............". 10minuts ago.I am so sorry about that.) > > bestwishes, > yang, > ---------the code-------------------------------------------------- > _/*I ran this program step by step to see "rate"and "rate_change".I found > that they were same*/ > public void changePE(){ > int rate=0; > int rate_changed=0; > PEList pelist=resource.getMachineList().getMachine(0).getPEList(); > int num=resource.getNumPE(); > > > /*to see the rate of PEs before change them. there were 6PEs and each PE~s > speed is 200*/ > for(int i=0;i<num;i++){ > rate=pelist.getMIPSRating(i); > } > > > /* try to change speed to 1000 using the method that I know*/ > for(int i=0;i<num;i++) { > pelist.add(new PE(i,1000)); > > // PE pe=new PE(i,1000); > // pe.setMIPSRating(1000); > } > MachineList mList = new MachineList(); > mList.add( new Machine(0, pelist) ); > String arch = "Sun Ultra"; // system architecture > String os = "Solaris"; // operating system > double time_zone = 0.0; // time zone this resource located > ResourceCharacteristics resource = new ResourceCharacteristics( > arch, os, mList, ResourceCharacteristics.SPACE_SHARED, > time_zone, 1); > > // PEList pelist1=resource.getMachineList().getMachine(0).getPEList(); > /* to check that they are changed or not*/ > for(int i=0;i<num;i++) > { > // rate_changed=pelist1.getMIPSRating(i) > rate_changed=pelist.getMIPSRating(i); > //rate_changed is same as rate. > } > } > -------------------------------------------------- > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Gridsim-users mailing list > Gri...@li... > https://lists.sourceforge.net/lists/listinfo/gridsim-users > -- ======================================================== Agustin Caminero-Herraez PhD Student Computing Systems Department The University of Castilla La Mancha, Albacete. Spain. Phone: +34 967 599200 Ext. 2693. Fax : +34 967 599224 http://www.i3a.uclm.es/ ======================================================== |