*
* @param bee An array of <code>Bee</code>s to be registered
*/
public void registerBees(Bee[] bee) {
for (Bee b : bee) {
BasicAgentInfo ai = (BasicAgentInfo) this.createAgentInfo();
ai.setAgent(b);
if (b.getName() == null)// if the agent has no name
// b.setName(b.getClass().getName() + "_" + Math.random());
b
.setName(P2PManager.getInstance().getP2PNetwork(0)
.getLocalNodeName().substring(
0,
P2PManager.getInstance().getP2PNetwork(
0).getLocalNodeName().indexOf(
"@"))
+ "."
+ b
.getClass()
.getName()
.replace(
"de.uniol.informatik.vlba.prototype.agent.",
"") + "_" + Math.random());
ai.setAgentName(b.getName());
Packager p = PackagingManager.getInstance()
.getPackager("StateOnly");
ai.setPackager(p);
ai.setSecurityPolicy(new EverythingAllowedPolicy());
SecurityPolicyManager.getInstance().assignSecurityPolicy(ai);
System.out.println("registered bee: " + b.getName());
System.out.println("loading bee: " + b.getName() + " ...");
try {
loadAgent(ai);