本文整理汇总了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);
}
示例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;
}
示例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();
}
}
示例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();
}
}
示例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;
}
示例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;
}
示例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;
}
示例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() );
}
示例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;
}
示例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.");
}
示例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);
}
示例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());
}
示例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);
}
示例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();
}
}
示例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();
}
}