// Properly handle the SL action, done and result operators
if (ce instanceof Action) {
return (AgentAction) ((Action) ce).getAction();
}
else if (ce instanceof Done) {
AgentAction act = (AgentAction) ((Done) ce).getAction();
if (act instanceof Action) {
return (AgentAction) ((Action) act).getAction();
}
else {
return act;
}
}
else if (ce instanceof Result) {
AgentAction act = (AgentAction) ((Result) ce).getAction();
if (act instanceof Action) {
return (AgentAction) ((Action) act).getAction();
}
else {
return act;