我正在研究Cloudsim.i想要为我自己的工作改变PowerVmAllocationPolicyAbstract类的findHostForVm()方法。将findHostForVm()更改为以下表达的抽象方法
public abstract class PowerVmAllocationPolicyAbstract extends VmAllocationPolicy {
public PowerVmAllocationPolicyAbstract(List<? extends Host> list) {
super(list);
}
public abstract PowerHost findHostForVm(Vm vm) ;
.
.
}
在我自己的课上我写了findHostForVm(Vm vm)。当我从powerDatacenter创建实例时,一个参数需要引用PowerVmAllocationPolicyAbstract .i在下面写的
public class D{
public PowerHost findHostForVm(List<Vm> vmlist) {
.
.
}
powerDatacenter = new PowerDatacenter(
name,
characteristics,
new D(),
new LinkedList<Storage>(),
5.0);
}
但它有错误。这个错误是:
constructor PowerDatacenter in class org.cloudbus.cloudsim.power.PowerDatacenter cannot be applied to given types;
required: java.lang.String,org.cloudbus.cloudsim.DatacenterCharacteristics,org.cloudbus.cloudsim.VmAl locationPolicy,java.util.List<org.cloudbus.cloudsim.Storage>,double
found: java.lang.String,org.cloudbus.cloudsim.DatacenterCharacteristics,cs.umu.se.vmp.alg. D,java.util.LinkedList<org.cloudbus.cloudsim.Storage>,double
reason: actual argument cs.umu.se.vmp.alg. D cannot be converted to org.cloudbus.cloudsim.VmAllocationPolicy by method invocation conversion
请帮帮我,我该怎么办? 非常感谢