A Sample Agent's Run Loop
public class PBANandGate extends PBAgent {
//variable defs
//other methods
protected void runLoop() {
if( ((Boolean) getInput(0)).booleanValue() &&
((Boolean) getInput(1)).booleanValue()) {
setOutput( Boolean.FALSE, 0);
}
else {
setOutput( Boolean.TRUE, 0);
}
try {
sleep(1000);
} catch (Exception e) {
}
}
Previous slide
Next slide
Back to first slide
View graphic version