|
From: yangyu <ya...@hp...> - 2007-10-05 04:48:04
|
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.
}
}
--------------------------------------------------
|