• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java PredicateType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.cloudbus.cloudsim.core.predicates.PredicateType的典型用法代码示例。如果您正苦于以下问题:Java PredicateType类的具体用法?Java PredicateType怎么用?Java PredicateType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PredicateType类属于org.cloudbus.cloudsim.core.predicates包,在下文中一共展示了PredicateType类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: sendInternalEvent

import org.cloudbus.cloudsim.core.predicates.PredicateType; //导入依赖的package包/类
private void sendInternalEvent() {
	if(channelTable.size() != 0) {
		if(nextEventTime == CloudSim.clock() + NetworkOperatingSystem.getMinTimeBetweenNetworkEvents())
			return;
		
		// More to process. Send event again
		double delay = this.nextFinishTime();

		// Shape the delay
		delay=NetworkOperatingSystem.round(delay);

		if (delay < NetworkOperatingSystem.getMinTimeBetweenNetworkEvents()) { 
			//Log.printLine(CloudSim.clock() + ":Channel: delay is too short: "+ delay);
			delay = NetworkOperatingSystem.getMinTimeBetweenNetworkEvents();
		}

		//Log.printLine(CloudSim.clock() + ": " + getName() + ".sendInternalEvent(): next finish time: "+ delay);

		if((nextEventTime > CloudSim.clock() + delay) || nextEventTime <= CloudSim.clock() ) 
		{
			CloudSim.cancelAll(getId(), new PredicateType(Constants.SDN_INTERNAL_PACKET_PROCESS));
			send(this.getId(), delay, Constants.SDN_INTERNAL_PACKET_PROCESS);
			nextEventTime = CloudSim.clock()+delay;
		}
	}
}
 
开发者ID:jayjmin,项目名称:cloudsimsdn,代码行数:27,代码来源:NetworkOperatingSystem.java


示例2: processpacket

import org.cloudbus.cloudsim.core.predicates.PredicateType; //导入依赖的package包/类
protected void processpacket(SimEvent ev) {
	// send packet to itself with switching delay (discarding other)
	CloudSim.cancelAll(getId(), new PredicateType(CloudSimTags.Network_Event_UP));
	schedule(getId(), switching_delay, CloudSimTags.Network_Event_UP);
	pktlist.add((NetworkPacket) ev.getData());

	// add the packet in the list

}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:10,代码来源:Switch.java


示例3: processpacket_down

import org.cloudbus.cloudsim.core.predicates.PredicateType; //导入依赖的package包/类
/**
 * Send Packet to switch connected through a downlink port
 * 
 * @param ev Event/packet to process
 */

@Override
protected void processpacket_down(SimEvent ev) {
	// packet coming from up level router.
	// has to send downward
	// check which switch to forward to
	// add packet in the switch list
	// add packet in the host list
	NetworkPacket hspkt = (NetworkPacket) ev.getData();
	int recvVMid = hspkt.pkt.reciever;
	CloudSim.cancelAll(getId(), new PredicateType(CloudSimTags.Network_Event_send));
	schedule(getId(), latency, CloudSimTags.Network_Event_send);

	if (level == NetworkConstants.Agg_LEVEL) {
		// packet is coming from root so need to be sent to edgelevel swich
		// find the id for edgelevel switch
		int switchid = dc.VmToSwitchid.get(recvVMid);
		List<NetworkPacket> pktlist = downlinkswitchpktlist.get(switchid);
		if (pktlist == null) {
			pktlist = new ArrayList<NetworkPacket>();
			downlinkswitchpktlist.put(switchid, pktlist);
		}
		pktlist.add(hspkt);
		return;
	}

}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:33,代码来源:AggregateSwitch.java


示例4: processpacket_up

import org.cloudbus.cloudsim.core.predicates.PredicateType; //导入依赖的package包/类
/**
 * Send Packet to switch connected through a downlink port
 * 
 * @param ev Event/packet to process
 */
@Override
protected void processpacket_up(SimEvent ev) {

	// packet coming from down level router.
	// has to send up
	// check which switch to forward to
	// add packet in the switch list

	NetworkPacket hspkt = (NetworkPacket) ev.getData();
	int recvVMid = hspkt.pkt.reciever;
	CloudSim.cancelAll(getId(), new PredicateType(CloudSimTags.Network_Event_send));
	schedule(getId(), switching_delay, CloudSimTags.Network_Event_send);

	if (level == NetworkConstants.ROOT_LEVEL) {
		// get id of edge router
		int edgeswitchid = dc.VmToSwitchid.get(recvVMid);
		// search which aggregate switch has it
		int aggSwtichid = -1;
		;
		for (Switch sw : downlinkswitches) {
			for (Switch edge : sw.downlinkswitches) {
				if (edge.getId() == edgeswitchid) {
					aggSwtichid = sw.getId();
					break;
				}
			}
		}
		if (aggSwtichid < 0) {
			System.out.println(" No destination for this packet");
		} else {
			List<NetworkPacket> pktlist = downlinkswitchpktlist.get(aggSwtichid);
			if (pktlist == null) {
				pktlist = new ArrayList<NetworkPacket>();
				downlinkswitchpktlist.put(aggSwtichid, pktlist);
			}
			pktlist.add(hspkt);
		}
	}
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:45,代码来源:RootSwitch.java


示例5: processVmMigrate

import org.cloudbus.cloudsim.core.predicates.PredicateType; //导入依赖的package包/类
@Override
protected void processVmMigrate(SimEvent ev, boolean ack) {
	updateCloudetProcessingWithoutSchedulingFutureEvents();
	super.processVmMigrate(ev, ack);
	SimEvent event = CloudSim.findFirstDeferred(getId(), new PredicateType(CloudSimTags.VM_MIGRATE));
	if (event == null || event.eventTime() > CloudSim.clock()) {
		updateCloudetProcessingWithoutSchedulingFutureEventsForce();
	}
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:10,代码来源:PowerDatacenter.java


示例6: sendInternalEvent

import org.cloudbus.cloudsim.core.predicates.PredicateType; //导入依赖的package包/类
private void sendInternalEvent() {
	CloudSim.cancelAll(getId(), new PredicateType(Constants.SDN_INTERNAL_PACKAGE_PROCESS));
	
	if(channelTable.size() != 0) {
		// More to process. Send event again
		double delay = this.nextFinishTime();
		Log.printLine(CloudSim.clock() + ": " + getName() + ".sendInternalEvent(): next finish time: "+ delay);
		
		send(this.getId(), delay, Constants.SDN_INTERNAL_PACKAGE_PROCESS);
	}
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:12,代码来源:NetworkOperatingSystem.java


示例7: processPacketDown

import org.cloudbus.cloudsim.core.predicates.PredicateType; //导入依赖的package包/类
/**
 * Sends a packet to Datacenter connected through a downlink port.
 *
 * @param ev Event/packet to process
 */
protected void processPacketDown(SimEvent ev) {
    // packet coming from up level router
    // has to send downward.
    // check which switch to forward to
    // add packet in the switch list
    // add packet in the host list
    // int src=ev.getSource();
    getSimulation().cancelAll(getId(), new PredicateType(CloudSimTags.NETWORK_EVENT_SEND));
    schedule(getId(), getSwitchingDelay(), CloudSimTags.NETWORK_EVENT_SEND);
}
 
开发者ID:manoelcampos,项目名称:cloudsim-plus,代码行数:16,代码来源:AbstractSwitch.java


示例8: processPacketUp

import org.cloudbus.cloudsim.core.predicates.PredicateType; //导入依赖的package包/类
/**
 * Sends a packet to Datacenter connected through a uplink port.
 *
 * @param ev Event/packet to process
 */
protected void processPacketUp(SimEvent ev) {
    // packet coming from down level router has to be sent up.
    // check which switch to forward to and add packet in the switch list
    getSimulation().cancelAll(getId(), new PredicateType(CloudSimTags.NETWORK_EVENT_SEND));
    schedule(getId(), switchingDelay, CloudSimTags.NETWORK_EVENT_SEND);
}
 
开发者ID:manoelcampos,项目名称:cloudsim-plus,代码行数:12,代码来源:AbstractSwitch.java


示例9: updateCloudletProcessing

import org.cloudbus.cloudsim.core.predicates.PredicateType; //导入依赖的package包/类
@Override
protected double updateCloudletProcessing() {
    if (getLastCloudletProcessingTime() == -1 || getLastCloudletProcessingTime() == getSimulation().clock()) {
        getSimulation().cancelAll(getId(), new PredicateType(CloudSimTags.VM_UPDATE_CLOUDLET_PROCESSING_EVENT));
        schedule(getId(), getSchedulingInterval(), CloudSimTags.VM_UPDATE_CLOUDLET_PROCESSING_EVENT);
        return Double.MAX_VALUE;
    }

    final double currentTime = getSimulation().clock();

    if (currentTime > getLastProcessTime()) {
        Log.printLine("\n");
        final double dcPowerUsageForTimeSpan = getDatacenterPowerUsageForTimeSpan();
        Log.printFormattedLine("\n%.2f: Consumed energy is %.2f W*sec\n", getSimulation().clock(), dcPowerUsageForTimeSpan);

        Log.printLine("\n\n--------------------------------------------------------------\n\n");
        final double nextCloudletFinishTime = getNextCloudletFinishTime(currentTime);

        setPower(getPower() + dcPowerUsageForTimeSpan);

        checkCloudletsCompletionForAllHosts();

        removeFinishedVmsFromEveryHost();
        Log.printLine();

        migrateVmsOutIfMigrationIsEnabled();
        scheduleUpdateOfCloudletsProcessingForFutureTime(nextCloudletFinishTime);
        setLastProcessTime(currentTime);
        return nextCloudletFinishTime;
    }

    return Double.MAX_VALUE;
}
 
开发者ID:manoelcampos,项目名称:cloudsim-plus,代码行数:34,代码来源:PowerDatacenterNonPowerAware.java


示例10: scheduleUpdateOfCloudletsProcessingForFutureTime

import org.cloudbus.cloudsim.core.predicates.PredicateType; //导入依赖的package包/类
/**
 * Schedules the next update of Cloudlets in this Host for a future time.
 *
 * @param nextCloudletFinishTime the time to schedule the update of Cloudlets in this Host, that is the expected
 *                               time of the next finishing Cloudlet among all existing Hosts.
 * @see #getNextCloudletFinishTime(double)
 */
private void scheduleUpdateOfCloudletsProcessingForFutureTime(double nextCloudletFinishTime) {
    if (nextCloudletFinishTime != Double.MAX_VALUE) {
        getSimulation().cancelAll(getId(), new PredicateType(CloudSimTags.VM_UPDATE_CLOUDLET_PROCESSING_EVENT));
        // getSimulation().cancelAll(getId(), CloudSim.SIM_ANY);
        send(getId(), getSchedulingInterval(), CloudSimTags.VM_UPDATE_CLOUDLET_PROCESSING_EVENT);
    }
}
 
开发者ID:manoelcampos,项目名称:cloudsim-plus,代码行数:15,代码来源:PowerDatacenterNonPowerAware.java


示例11: processVmMigrate

import org.cloudbus.cloudsim.core.predicates.PredicateType; //导入依赖的package包/类
@Override
protected void processVmMigrate(SimEvent ev, boolean ack) {
    if (getSimulation().clock() <= getLastProcessTime()) {
        return;
    }

    super.updateHostsProcessing();
    super.processVmMigrate(ev, ack);
    final SimEvent event = getSimulation().findFirstDeferred(getId(), new PredicateType(CloudSimTags.VM_MIGRATE));
    if (Objects.isNull(event) || event.eventTime() > getSimulation().clock()) {
        super.updateHostsProcessing();
    }
}
 
开发者ID:manoelcampos,项目名称:cloudsim-plus,代码行数:14,代码来源:PowerDatacenter.java



注:本文中的org.cloudbus.cloudsim.core.predicates.PredicateType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ServiceTypeListenerStatus类代码示例发布时间:2022-05-22
下一篇:
Java BottomNavigation类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap