当前位置: 首页>>代码示例>>Java>>正文


Java FIPAException.printStackTrace方法代码示例

本文整理汇总了Java中jade.domain.FIPAException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java FIPAException.printStackTrace方法的具体用法?Java FIPAException.printStackTrace怎么用?Java FIPAException.printStackTrace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jade.domain.FIPAException的用法示例。


在下文中一共展示了FIPAException.printStackTrace方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setup

import jade.domain.FIPAException; //导入方法依赖的package包/类
@Override
protected void setup() {

    setRandomWallet();

    addBehaviour(new BidRequestsServer());

    // Register the auction-seller service in the yellow pages
    DFAgentDescription dfd = new DFAgentDescription();
    dfd.setName(getAID());
    ServiceDescription sd = new ServiceDescription();
    sd.setType("auction-bidder");
    sd.setName("MultiAgentSystem-auctions");
    dfd.addServices(sd);

    try {
        DFService.register(this, dfd);
    } catch (FIPAException e) {
        e.printStackTrace();
    }
    System.out.println(getAID().getName() + " ready to buy some stuff. My wallet is $" + wallet);
}
 
开发者ID:ohvitorino,项目名称:auctions,代码行数:23,代码来源:BidderAgent.java

示例2: findRobots

import jade.domain.FIPAException; //导入方法依赖的package包/类
private boolean findRobots() {
	boolean found = false;
	DFAgentDescription agentDescriptionTemplate = new DFAgentDescription();
	ServiceDescription serviceTransport = new ServiceDescription();
	serviceTransport.setType("Raw");

	SearchConstraints searchConstraints = new SearchConstraints();
	searchConstraints.setSearchId("Raw");

	agentDescriptionTemplate.addServices(serviceTransport);
	try {
		DFAgentDescription[] foundRobots = DFService.search(this, agentDescriptionTemplate);
		_broadcastAddr = new AID[foundRobots.length];
		for (int i = 0; i < foundRobots.length; i++) {
			found = true;
			_broadcastAddr[i] = foundRobots[i].getName();
		}
	} catch (FIPAException exception) {
		exception.printStackTrace();
	}
	return found;
}
 
开发者ID:gseteamproject,项目名称:gseproject,代码行数:23,代码来源:RobotAgent.java

示例3: registerDFRaw

import jade.domain.FIPAException; //导入方法依赖的package包/类
private void registerDFRaw() {

		String agentServiceGroup = new String("Raw");
		String agentServiceName = new String("Raw");

		ServiceDescription serviceDescription = new ServiceDescription();
		serviceDescription.setName(agentServiceGroup);
		serviceDescription.setType(agentServiceName);
		DFAgentDescription agentDescription = new DFAgentDescription();
		agentDescription.setName(getAID());
		agentDescription.addServices(serviceDescription);
		try {
			DFService.register(this, agentDescription);
		} catch (FIPAException exception) {
			exception.printStackTrace();
		}
	}
 
开发者ID:gseteamproject,项目名称:gseproject,代码行数:18,代码来源:RobotAgent.java

示例4: registerNeedWorker

import jade.domain.FIPAException; //导入方法依赖的package包/类
private void registerNeedWorker() {
	DFAgentDescription dfServiceDescription = new DFAgentDescription();
	if (this.floor instanceof CleaningFloor) {
		ServiceDescription needClean = new ServiceDescription();
		needClean.setName("needClean");
		needClean.setType("needClean");
		dfServiceDescription.addServices(needClean);
	} else {
		ServiceDescription needPaint = new ServiceDescription();
		needPaint.setName("needPaint");
		needPaint.setType("needPaint");
		dfServiceDescription.addServices(needPaint);
	}
	try {
		DFService.register(this.floorAgent, dfServiceDescription);
	} catch (FIPAException e) {
		e.printStackTrace();
	}
}
 
开发者ID:gseteamproject,项目名称:gseproject,代码行数:20,代码来源:FloorCommunicator.java

示例5: getServerName

import jade.domain.FIPAException; //导入方法依赖的package包/类
public AID getServerName() {
	if (server_name != null) {
		return server_name;
	}
	DFAgentDescription template=new DFAgentDescription();
	ServiceDescription sd=new ServiceDescription();
	sd.setType("Organisation");
	sd.setName("Multiplay");
	template.addServices(sd);
	try{
		DFAgentDescription[] result=DFService.search(this, template);
		if(result.length>0){
			server_name = result[0].getName();
		}
	}catch(FIPAException fe){
		fe.printStackTrace();
	}
	return server_name;
}
 
开发者ID:hukewei,项目名称:leapband,代码行数:20,代码来源:UserAgent.java

示例6: getNoteAgentName

import jade.domain.FIPAException; //导入方法依赖的package包/类
public AID getNoteAgentName() {
	if (note_agent_name != null) {
		return note_agent_name;
	}
	DFAgentDescription template=new DFAgentDescription();
	ServiceDescription sd=new ServiceDescription();
	sd.setType("Organisation");
	sd.setName("MoveToNote");
	template.addServices(sd);
	try{
		DFAgentDescription[] result=DFService.search(this, template);
		if(result.length>0){
			note_agent_name = result[0].getName();
		}
	}catch(FIPAException fe){
		fe.printStackTrace();
	}
	return note_agent_name;
}
 
开发者ID:hukewei,项目名称:leapband,代码行数:20,代码来源:UserAgent.java

示例7: getMySoundAgent

import jade.domain.FIPAException; //导入方法依赖的package包/类
public AID getMySoundAgent() {
	if (my_sound_name != null) {
		return my_sound_name;
	}
	DFAgentDescription template=new DFAgentDescription();
	ServiceDescription sd=new ServiceDescription();
	sd.setType("Sound");
	sd.setName("SoundPlay");
	template.addServices(sd);
	try{
		DFAgentDescription[] result=DFService.search(this, template);
		if(result.length>0){
			for (int i = 0; i < result.length; i++) {
				System.out.println("possible name = " + result[i].getName().getName());
				if (result[i].getName().getName().contains(SoundPlayAgentNickName)) {
					my_sound_name = result[i].getName();
					break;
				}
			}
		}
	}catch(FIPAException fe){
		fe.printStackTrace();
	}
	return my_sound_name;
}
 
开发者ID:hukewei,项目名称:leapband,代码行数:26,代码来源:UserAgent.java

示例8: setup

import jade.domain.FIPAException; //导入方法依赖的package包/类
protected void setup() {
	DFAgentDescription dfd = new DFAgentDescription();
	dfd.setName(getAID());
	ServiceDescription sd = new ServiceDescription();
	sd.setType("Organisation");
	sd.setName("MoveToNote");
	dfd.addServices(sd);
	try {
	DFService.register(this, dfd);
	}
	catch (FIPAException fe) {
	fe.printStackTrace();
	}
	
	this.addBehaviour(new SoundMessageDaemonBehaviour() );	
	
}
 
开发者ID:hukewei,项目名称:leapband,代码行数:18,代码来源:MoveToSoundAgent.java

示例9: action

import jade.domain.FIPAException; //导入方法依赖的package包/类
@Override
public void action() {
	ACLMessage msg = new ACLMessage(ACLMessage.QUERY_IF);
	msg.setLanguage("English");
	msg.setContent("free");
	DFAgentDescription orderPickerDesc = new DFAgentDescription();
	ServiceDescription sd = new ServiceDescription();
	sd.setType("pick");
	sd.setName("pick");
	orderPickerDesc.addServices(sd);
	try {
		for(DFAgentDescription desc : DFService.search(OrderAgent.this, orderPickerDesc)) {
			msg.addReceiver(desc.getName());
		}
	} catch(FIPAException ex) {
		ex.printStackTrace();
	}
	send(msg);
	pick = new OrderPickerPicker();
	addBehaviour(pick);
	removeBehaviour(query);
	query = null;
}
 
开发者ID:autarchprinceps,项目名称:Multiagent-Warehouse,代码行数:24,代码来源:OrderAgent.java

示例10: requestAllDeliveryRobots

import jade.domain.FIPAException; //导入方法依赖的package包/类
private void requestAllDeliveryRobots() {

			DFAgentDescription template = new DFAgentDescription();
			ServiceDescription sd = new ServiceDescription();
			sd.setType("shelfPicking");
			template.addServices(sd);
			try {
				DFAgentDescription[] result = DFService.search(myAgent,
						template);
				ACLMessage msg = new ACLMessage(ACLMessage.REQUEST);
				for (DFAgentDescription agent : result) {
					msg.addReceiver(agent.getName());
					send(msg);
				}
			} catch (FIPAException fe) {
				fe.printStackTrace();
			}
			System.out
					.println("Picker: Asking all the delivery robots if they are available.");
		}
 
开发者ID:ChrisQuignon,项目名称:kivasim,代码行数:21,代码来源:Picker.java

示例11: setup

import jade.domain.FIPAException; //导入方法依赖的package包/类
protected void setup() {
	done = false;
	items = new HashMap<>();
	DFAgentDescription dfd = new DFAgentDescription();
	dfd.setName(getAID());
	try {
		DFService.register(this, dfd);
	} catch(FIPAException ex) {
		ex.printStackTrace();
	}
	
	Object[] args = this.getArguments();
	if(args != null && args.length == 1 && args[0] instanceof List<?>) {
		for(Pair<String, Integer> p : (List<Pair<String, Integer>>)args[0]) {
			items.put(p, false);
		}
	} else {
		System.err.println("[OrderAgent]: Argument Error");
	}
	query = new OrderPickerQuerier();
	
	finish = new FinishChecker();
	addBehaviour(query);
}
 
开发者ID:autarchprinceps,项目名称:Multiagent-Warehouse,代码行数:25,代码来源:OrderAgent.java

示例12: setup

import jade.domain.FIPAException; //导入方法依赖的package包/类
protected void setup() {
	DFAgentDescription dfd = new DFAgentDescription();
	dfd.setName(getAID());
	ServiceDescription sd = new ServiceDescription();
	sd.setName("WarehouseAgent");
	sd.setType("WA");
	dfd.addServices(sd);
	try {
		DFService.register(this, dfd);
	} catch(FIPAException ex) {
		ex.printStackTrace();
	}
	
	this.addBehaviour(new OrderRequestReceiver());
	this.addBehaviour(new FinishedOrderReceiver());
	this.addBehaviour(new FailedOrderReceiver());
}
 
开发者ID:autarchprinceps,项目名称:Multiagent-Warehouse,代码行数:18,代码来源:WarehouseAgent.java

示例13: setup

import jade.domain.FIPAException; //导入方法依赖的package包/类
@Override
protected void setup()
{
	DFAgentDescription agentDescription = new DFAgentDescription();
	ServiceDescription serviceDescription = new ServiceDescription();
	serviceDescription.setName(SERVICE_NAME);
	serviceDescription.setType(SERVICE_NAME);
	agentDescription.setName(getAID());
	agentDescription.addServices(serviceDescription);
	try
	{
		DFService.register(this, agentDescription);
	}
	catch (FIPAException e)
	{
		e.printStackTrace();
	}

	// System.out.println(getLocalName() + "available.");
	this.isIdle = true;

	this.idle = new IdleBehaviour();
	this.orderReceiver = new OrderReceiver();
	addBehaviour(this.idle);
	addBehaviour(this.orderReceiver);
}
 
开发者ID:autarchprinceps,项目名称:Multiagent-Warehouse,代码行数:27,代码来源:OrderPicker.java

示例14: registerDFService

import jade.domain.FIPAException; //导入方法依赖的package包/类
/**
 * Registers a service for the agency to the DFService of JADE.
 * @param type the type
 * @param name the name
 */
protected void registerDFService(String type, String name, String ownership) {
	DFAgentDescription agentDescription = createAgentDescription(type, name, ownership);
	try {
		DFService.register(this.myAgent, agentDescription);
	} catch (FIPAException fe) {
		fe.printStackTrace();
	}
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:14,代码来源:SimulationServiceBehaviour.java

示例15: deregisterDFService

import jade.domain.FIPAException; //导入方法依赖的package包/类
/**
 * Unregisters a service for the agency to the DFService of JADE.
 */
protected void deregisterDFService() {
	try {
		DFService.deregister(this.myAgent);
	} catch (FIPAException fe) {
		fe.printStackTrace();
	}
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:11,代码来源:SimulationServiceBehaviour.java


注:本文中的jade.domain.FIPAException.printStackTrace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。