本文整理汇总了Java中vnreal.network.NetworkEntity.get方法的典型用法代码示例。如果您正苦于以下问题:Java NetworkEntity.get方法的具体用法?Java NetworkEntity.get怎么用?Java NetworkEntity.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vnreal.network.NetworkEntity
的用法示例。
在下文中一共展示了NetworkEntity.get方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMappedVirtualEntities
import vnreal.network.NetworkEntity; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
static LinkedList<NetworkEntity<AbstractDemand>> getMappedVirtualEntities(Collection<? extends NetworkEntity<AbstractResource>> entities) {
LinkedList<NetworkEntity<AbstractDemand>> result = new LinkedList<NetworkEntity<AbstractDemand>>();
for (NetworkEntity<AbstractResource> e : entities) {
for (AbstractResource res : e.get()) {
for (Mapping m : res.getMappings()) {
if (m.getDemand().getOwner() != null) {
NetworkEntity<AbstractDemand> owner = (NetworkEntity<AbstractDemand>) m.getDemand().getOwner();
if (!result.contains(owner)) {
result.add(owner);
}
}
}
}
}
return result;
}
示例2: getStressLevel
import vnreal.network.NetworkEntity; //导入方法依赖的package包/类
public static int getStressLevel(NetworkEntity<? extends AbstractResource> e) {
List<NetworkEntity<?>> vEntities = new LinkedList<NetworkEntity<?>>();
for (AbstractResource r : e.get()) {
for (vnreal.mapping.Mapping m : r.getMappings()) {
AbstractDemand d = m.getDemand();
if (!(d instanceof HiddenHopEnergyDemand)) {
NetworkEntity<?> owner = d.getOwner();
if (!vEntities.contains(owner)) {
vEntities.add(owner);
}
}
}
}
return vEntities.size();
}
示例3: getResource
import vnreal.network.NetworkEntity; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public static <T extends AbstractResource> T getResource(NetworkEntity<AbstractResource> s, Class<T> type) {
for (AbstractResource r : s.get()) {
if (r.getClass().isAssignableFrom(type)) {
return (T) r;
}
}
return null;
}
示例4: getCpuAvailable
import vnreal.network.NetworkEntity; //导入方法依赖的package包/类
public static double getCpuAvailable(
NetworkEntity<? extends AbstractResource> n1) {
for (AbstractResource res : n1.get()) {
if (res instanceof CpuResource) {
return ((CpuResource) res).getAvailableCycles();
}
}
return 0.0;
}
示例5: getBandwidthAvailable
import vnreal.network.NetworkEntity; //导入方法依赖的package包/类
public static double getBandwidthAvailable(
NetworkEntity<? extends AbstractResource> n1) {
for (AbstractResource res : n1.get()) {
if (res instanceof BandwidthResource) {
return ((BandwidthResource) res).getAvailableBandwidth();
}
}
return 0.0;
}
示例6: getBandwidthDemand
import vnreal.network.NetworkEntity; //导入方法依赖的package包/类
public static double getBandwidthDemand(NetworkEntity<? extends AbstractDemand> n) {
for (AbstractDemand dem : n.get()) {
if (dem instanceof BandwidthDemand) {
return ((BandwidthDemand) dem).getDemandedBandwidth();
}
}
return 0.0;
}
示例7: getCpuRemaining
import vnreal.network.NetworkEntity; //导入方法依赖的package包/类
public static double getCpuRemaining(
NetworkEntity<? extends AbstractResource> n1,
NetworkEntity<? extends AbstractDemand> n2) {
for (AbstractResource res : n1.get()) {
if (res instanceof CpuResource) {
for (AbstractDemand dem : n2.get()) {
if (dem instanceof CpuDemand) {
return ((CpuResource) res).getAvailableCycles()
- (((CpuDemand) dem)).getDemandedCycles();
}
}
}
}
return 0.0;
}
示例8: getCpuResource
import vnreal.network.NetworkEntity; //导入方法依赖的package包/类
public static CpuResource getCpuResource(
NetworkEntity<? extends AbstractResource> n) {
for (AbstractResource res : n.get()) {
if (res instanceof CpuResource) {
return (CpuResource) res;
}
}
return null;
}
示例9: getCpuDemand
import vnreal.network.NetworkEntity; //导入方法依赖的package包/类
public static CpuDemand getCpuDemand(NetworkEntity<? extends AbstractDemand> n) {
for (AbstractDemand dem : n.get()) {
if (dem instanceof CpuDemand) {
return (CpuDemand) dem;
}
}
return null;
}