本文整理汇总了Java中jade.lang.acl.ACLMessage.QUERY_IF属性的典型用法代码示例。如果您正苦于以下问题:Java ACLMessage.QUERY_IF属性的具体用法?Java ACLMessage.QUERY_IF怎么用?Java ACLMessage.QUERY_IF使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类jade.lang.acl.ACLMessage
的用法示例。
在下文中一共展示了ACLMessage.QUERY_IF属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: kqmlToACL
public static ACLMessage kqmlToACL(String p) {
if (p.equals("tell")) {
return new ACLMessage(ACLMessage.INFORM);
} else if (p.equals("askOne")) {
return new ACLMessage(ACLMessage.QUERY_REF);
} else if (p.equals("achieve")) {
return new ACLMessage(ACLMessage.REQUEST);
} else if (p.toLowerCase().equals("accept_proposal")) {
return new ACLMessage(ACLMessage.ACCEPT_PROPOSAL);
} else if (p.toLowerCase().equals("reject_proposal")) {
return new ACLMessage(ACLMessage.REJECT_PROPOSAL);
} else if (p.toLowerCase().equals("query_if")) {
return new ACLMessage(ACLMessage.QUERY_IF);
} else if (p.toLowerCase().equals("inform_if")) {
return new ACLMessage(ACLMessage.INFORM_IF);
}
int perf = ACLMessage.getInteger(p);
if (perf == -1 || perf == ACLMessage.NOT_UNDERSTOOD) {
ACLMessage m = new ACLMessage(ACLMessage.INFORM_REF);
m.addUserDefinedParameter("kqml-performative", p);
return m;
}
return new ACLMessage(perf);
}
示例2: action
@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;
}
示例3: action
@Override
public void action()
{
ACLMessage broadcast = new ACLMessage(ACLMessage.QUERY_IF);
broadcast.setProtocol("request-item");
DFAgentDescription orderPickerDesc = new DFAgentDescription();
ServiceDescription sd = new ServiceDescription();
sd.setType("shelf");
orderPickerDesc.addServices(sd);
try
{
for (DFAgentDescription desc : DFService.search(OrderPicker.this, orderPickerDesc))
{
broadcast.addReceiver(desc.getName());
}
}
catch (FIPAException e)
{
e.printStackTrace();
}
log("---new broadcast requiredItems---");
log("broadcast: " + this.requiredItems);
log("");
broadcast.setContent(this.requiredItems.toString());
send(broadcast);
removeBehaviour(this);
}