本文整理汇总了Java中vnreal.hiddenhopmapping.HiddenHopEnergyDemand.occupy方法的典型用法代码示例。如果您正苦于以下问题:Java HiddenHopEnergyDemand.occupy方法的具体用法?Java HiddenHopEnergyDemand.occupy怎么用?Java HiddenHopEnergyDemand.occupy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vnreal.hiddenhopmapping.HiddenHopEnergyDemand
的用法示例。
在下文中一共展示了HiddenHopEnergyDemand.occupy方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: occupyHiddenHop
import vnreal.hiddenhopmapping.HiddenHopEnergyDemand; //导入方法依赖的package包/类
private static Collection<ResourceDemandEntry> occupyHiddenHop(
SubstrateNode s, List<AbstractDemand> hiddenHopCPUDemands) {
LinkedList<ResourceDemandEntry> result =
new LinkedList<ResourceDemandEntry>();
PowerResource er = Utils.getEnergyResource(s);
if (er != null) {
HiddenHopEnergyDemand demand = new HiddenHopEnergyDemand(s);
demand.occupy(er);
result.add(new ResourceDemandEntry(er, demand));
}
if (hiddenHopCPUDemands != null)
for (AbstractDemand hd : hiddenHopCPUDemands) {
for (AbstractResource r : s.get()) {
if (r.accepts(hd) && r.fulfills(hd) && hd.occupy(r)) {
result.add(new ResourceDemandEntry(r, hd));
continue;
}
}
throw new AssertionError();
}
return result;
}
示例2: occupyHiddenHop
import vnreal.hiddenhopmapping.HiddenHopEnergyDemand; //导入方法依赖的package包/类
private static Collection<ResourceDemandEntry<AbstractResource, AbstractDemand>> occupyHiddenHop(
SubstrateNode s, List<AbstractDemand> hiddenHopCPUDemands, boolean useEnergyResource) {
LinkedList<ResourceDemandEntry<AbstractResource, AbstractDemand>> result =
new LinkedList<ResourceDemandEntry<AbstractResource, AbstractDemand>>();
if (useEnergyResource) {
EnergyResource er = Utils.getEnergyResource(s);
HiddenHopEnergyDemand demand = new HiddenHopEnergyDemand(s);
demand.occupy(er);
result.add(new ResourceDemandEntry<AbstractResource, AbstractDemand>(er, demand));
}
for (AbstractDemand hd : hiddenHopCPUDemands) {
for (AbstractResource r : s.get()) {
if (r.accepts(hd) && r.fulfills(hd) && hd.occupy(r)) {
result.add(new ResourceDemandEntry<AbstractResource, AbstractDemand>(r, hd));
continue;
}
}
throw new AssertionError();
}
return result;
}
示例3: occupyHiddenHop
import vnreal.hiddenhopmapping.HiddenHopEnergyDemand; //导入方法依赖的package包/类
private static Collection<ResourceDemandEntry<AbstractResource, AbstractDemand>> occupyHiddenHop(
SubstrateNode s, List<AbstractDemand> hiddenHopCPUDemands, boolean useEnergyResource) {
LinkedList<ResourceDemandEntry<AbstractResource, AbstractDemand>> result =
new LinkedList<ResourceDemandEntry<AbstractResource, AbstractDemand>>();
if (useEnergyResource) {
PowerResource er = Utils.getEnergyResource(s);
HiddenHopEnergyDemand demand = new HiddenHopEnergyDemand(s);
demand.occupy(er);
result.add(new ResourceDemandEntry<AbstractResource, AbstractDemand>(er, demand));
}
for (AbstractDemand hd : hiddenHopCPUDemands) {
for (AbstractResource r : s.get()) {
if (r.accepts(hd) && r.fulfills(hd) && hd.occupy(r)) {
result.add(new ResourceDemandEntry<AbstractResource, AbstractDemand>(r, hd));
continue;
}
}
throw new AssertionError();
}
return result;
}