return ((String) obj).indexOf(argEvalString(context, 0)) != -1
? Boolean.TRUE
: Boolean.FALSE;
} else if (obj instanceof AgentSet) {
Agent agent = argEvalAgent(context, 0);
AgentSet agentset = (AgentSet) obj;
if (agent instanceof Turtle) {
if (agent.id == -1) {
return Boolean.FALSE;
}
if (agentset.type() != Turtle.class) {
return Boolean.FALSE;
}
if (agentset == world.turtles()) {
return Boolean.TRUE;
}
if (world.isBreed(agentset)) {
return agentset == ((Turtle) agent).getBreed()
? Boolean.TRUE
: Boolean.FALSE;
}
}
if (agent instanceof Link) {
if (agent.id == -1) {
return Boolean.FALSE;
}
if (agentset.type() != Link.class) {
return Boolean.FALSE;
}
if (agentset == world.links()) {
return Boolean.TRUE;
}
if (world.isBreed(agentset)) {
return agentset == ((Link) agent).getBreed() ?
Boolean.TRUE :
Boolean.FALSE;
}
} else if (agent instanceof Patch) {
if (agentset.type() != Patch.class) {
return Boolean.FALSE;
}
if (agentset == world.patches()) {
return Boolean.TRUE;
}
}
return agentset.contains(agent)
? Boolean.TRUE
: Boolean.FALSE;
} else {
throw new ArgumentTypeException
(context, this, 1,