I have one agent with its services that implements a CyclicBehaviour
were and I wanna see those services or use its methods, how can I do it?
for example
Agent:
public class agent1 extends Agent {
int[] numbers= {11, 20, 40};
public void setup() {
DFAgentDescription dfd = new DFAgentDescription();
dfd.setName(getAID());
ServiceDescription sd = new ServiceDescription();
sd.setName("number");
sd.setType(numbers[0]);
sd.addOntologies("ontology");
..........
sd.addNumbers(new SLCodec().getName());
dfd.addServices(sd);
try {
DFService.register(this, dfd);
}
catch(FIPAException e) {
System.err.println("Agente"+ getLocalName()+": "+ e.getMessage());
}
};
public String getNumber()
{
return idiomas;
}
}
Behaviour:
public class CyclicTraduce extends CyclicBehaviour {
@Override
public void action() {
// TODO Auto-generated method stub
//I want to use getNumber method of agent here
}
}