use of nars.operator.ImaginationSpace in project opennars by opennars.
the class VisualSpace method ConstructSpace.
@Override
public ImaginationSpace ConstructSpace(Conjunction program) {
if (program.isSpatial || program.getTemporalOrder() != TemporalRules.ORDER_FORWARD) {
// would be a strange program :)
return null;
}
Term beginning = program.term[0];
if (beginning.imagination == null) {
return null;
}
ImaginationSpace cur = beginning.imagination;
// "execute program":
for (int i = 1; i < program.term.length; i += 1) {
if (!(program.term[i] instanceof Operation)) {
return null;
}
Operation oper = (Operation) program.term[i];
if (!IsOperationInSpace(oper)) {
return null;
}
cur = cur.ProgressSpace(oper, cur);
i++;
}
return null;
}
Aggregations