Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
G
gpucloudsim
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LPDS
gpucloudsim
Commits
5ce62d57
Commit
5ce62d57
authored
Oct 16, 2012
by
rodrigo.calheiros@gmail.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix in PeList: problem in the generics declaration.
parent
dc88765a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
PeList.java
...sim/src/main/java/org/cloudbus/cloudsim/lists/PeList.java
+12
-12
No files found.
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/lists/PeList.java
View file @
5ce62d57
...
@@ -31,7 +31,7 @@ public class PeList {
...
@@ -31,7 +31,7 @@ public class PeList {
* @pre id >= 0
* @pre id >= 0
* @post $none
* @post $none
*/
*/
public
static
<
T
extends
Pe
>
Pe
getById
(
List
<
Pe
>
peList
,
int
id
)
{
public
static
<
T
extends
Pe
>
Pe
getById
(
List
<
T
>
peList
,
int
id
)
{
for
(
Pe
pe
:
peList
)
{
for
(
Pe
pe
:
peList
)
{
if
(
pe
.
getId
()
==
id
)
{
if
(
pe
.
getId
()
==
id
)
{
return
pe
;
return
pe
;
...
@@ -49,7 +49,7 @@ public class PeList {
...
@@ -49,7 +49,7 @@ public class PeList {
* @pre id >= 0
* @pre id >= 0
* @post $none
* @post $none
*/
*/
public
static
<
T
extends
Pe
>
int
getMips
(
List
<
Pe
>
peList
,
int
id
)
{
public
static
<
T
extends
Pe
>
int
getMips
(
List
<
T
>
peList
,
int
id
)
{
Pe
pe
=
getById
(
peList
,
id
);
Pe
pe
=
getById
(
peList
,
id
);
if
(
pe
!=
null
)
{
if
(
pe
!=
null
)
{
return
pe
.
getMips
();
return
pe
.
getMips
();
...
@@ -65,7 +65,7 @@ public class PeList {
...
@@ -65,7 +65,7 @@ public class PeList {
* @pre $none
* @pre $none
* @post $none
* @post $none
*/
*/
public
static
<
T
extends
Pe
>
int
getTotalMips
(
List
<
Pe
>
peList
)
{
public
static
<
T
extends
Pe
>
int
getTotalMips
(
List
<
T
>
peList
)
{
int
totalMips
=
0
;
int
totalMips
=
0
;
for
(
Pe
pe
:
peList
)
{
for
(
Pe
pe
:
peList
)
{
totalMips
+=
pe
.
getMips
();
totalMips
+=
pe
.
getMips
();
...
@@ -79,7 +79,7 @@ public class PeList {
...
@@ -79,7 +79,7 @@ public class PeList {
* @param peList the pe list
* @param peList the pe list
* @return the utilization
* @return the utilization
*/
*/
public
static
<
T
extends
Pe
>
double
getMaxUtilization
(
List
<
Pe
>
peList
)
{
public
static
<
T
extends
Pe
>
double
getMaxUtilization
(
List
<
T
>
peList
)
{
double
maxUtilization
=
0
;
double
maxUtilization
=
0
;
for
(
Pe
pe
:
peList
)
{
for
(
Pe
pe
:
peList
)
{
double
utilization
=
pe
.
getPeProvisioner
().
getUtilization
();
double
utilization
=
pe
.
getPeProvisioner
().
getUtilization
();
...
@@ -97,7 +97,7 @@ public class PeList {
...
@@ -97,7 +97,7 @@ public class PeList {
* @param peList the pe list
* @param peList the pe list
* @return the utilization
* @return the utilization
*/
*/
public
static
<
T
extends
Pe
>
double
getMaxUtilizationAmongVmsPes
(
List
<
Pe
>
peList
,
Vm
vm
)
{
public
static
<
T
extends
Pe
>
double
getMaxUtilizationAmongVmsPes
(
List
<
T
>
peList
,
Vm
vm
)
{
double
maxUtilization
=
0
;
double
maxUtilization
=
0
;
for
(
Pe
pe
:
peList
)
{
for
(
Pe
pe
:
peList
)
{
if
(
pe
.
getPeProvisioner
().
getAllocatedMipsForVm
(
vm
)
==
null
)
{
if
(
pe
.
getPeProvisioner
().
getAllocatedMipsForVm
(
vm
)
==
null
)
{
...
@@ -119,7 +119,7 @@ public class PeList {
...
@@ -119,7 +119,7 @@ public class PeList {
* @pre $none
* @pre $none
* @post $none
* @post $none
*/
*/
public
static
<
T
extends
Pe
>
Pe
getFreePe
(
List
<
Pe
>
peList
)
{
public
static
<
T
extends
Pe
>
Pe
getFreePe
(
List
<
T
>
peList
)
{
for
(
Pe
pe
:
peList
)
{
for
(
Pe
pe
:
peList
)
{
if
(
pe
.
getStatus
()
==
Pe
.
FREE
)
{
if
(
pe
.
getStatus
()
==
Pe
.
FREE
)
{
return
pe
;
return
pe
;
...
@@ -136,7 +136,7 @@ public class PeList {
...
@@ -136,7 +136,7 @@ public class PeList {
* @pre $none
* @pre $none
* @post $result >= 0
* @post $result >= 0
*/
*/
public
static
<
T
extends
Pe
>
int
getNumberOfFreePes
(
List
<
Pe
>
peList
)
{
public
static
<
T
extends
Pe
>
int
getNumberOfFreePes
(
List
<
T
>
peList
)
{
int
cnt
=
0
;
int
cnt
=
0
;
for
(
Pe
pe
:
peList
)
{
for
(
Pe
pe
:
peList
)
{
if
(
pe
.
getStatus
()
==
Pe
.
FREE
)
{
if
(
pe
.
getStatus
()
==
Pe
.
FREE
)
{
...
@@ -157,7 +157,7 @@ public class PeList {
...
@@ -157,7 +157,7 @@ public class PeList {
* @pre peID >= 0
* @pre peID >= 0
* @post $none
* @post $none
*/
*/
public
static
<
T
extends
Pe
>
boolean
setPeStatus
(
List
<
Pe
>
peList
,
int
id
,
int
status
)
{
public
static
<
T
extends
Pe
>
boolean
setPeStatus
(
List
<
T
>
peList
,
int
id
,
int
status
)
{
Pe
pe
=
getById
(
peList
,
id
);
Pe
pe
=
getById
(
peList
,
id
);
if
(
pe
!=
null
)
{
if
(
pe
!=
null
)
{
pe
.
setStatus
(
status
);
pe
.
setStatus
(
status
);
...
@@ -174,7 +174,7 @@ public class PeList {
...
@@ -174,7 +174,7 @@ public class PeList {
* @pre $none
* @pre $none
* @post $result >= 0
* @post $result >= 0
*/
*/
public
static
<
T
extends
Pe
>
int
getNumberOfBusyPes
(
List
<
Pe
>
peList
)
{
public
static
<
T
extends
Pe
>
int
getNumberOfBusyPes
(
List
<
T
>
peList
)
{
int
cnt
=
0
;
int
cnt
=
0
;
for
(
Pe
pe
:
peList
)
{
for
(
Pe
pe
:
peList
)
{
if
(
pe
.
getStatus
()
==
Pe
.
BUSY
)
{
if
(
pe
.
getStatus
()
==
Pe
.
BUSY
)
{
...
@@ -194,7 +194,7 @@ public class PeList {
...
@@ -194,7 +194,7 @@ public class PeList {
* @param failed the new value for the "failed" parameter
* @param failed the new value for the "failed" parameter
*/
*/
public
static
<
T
extends
Pe
>
void
setStatusFailed
(
public
static
<
T
extends
Pe
>
void
setStatusFailed
(
List
<
Pe
>
peList
,
List
<
T
>
peList
,
String
resName
,
String
resName
,
int
hostId
,
int
hostId
,
boolean
failed
)
{
boolean
failed
)
{
...
@@ -216,7 +216,7 @@ public class PeList {
...
@@ -216,7 +216,7 @@ public class PeList {
* @param failed the new value for the "failed" parameter
* @param failed the new value for the "failed" parameter
* @param peList the pe list
* @param peList the pe list
*/
*/
public
static
<
T
extends
Pe
>
void
setStatusFailed
(
List
<
Pe
>
peList
,
boolean
failed
)
{
public
static
<
T
extends
Pe
>
void
setStatusFailed
(
List
<
T
>
peList
,
boolean
failed
)
{
// a loop to set the status of all the PEs in this machine
// a loop to set the status of all the PEs in this machine
for
(
Pe
pe
:
peList
)
{
for
(
Pe
pe
:
peList
)
{
if
(
failed
)
{
if
(
failed
)
{
...
@@ -227,4 +227,4 @@ public class PeList {
...
@@ -227,4 +227,4 @@ public class PeList {
}
}
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment