Пример #1
0
 public static DialogueKBFormula processGoalExpression(DialogueKBFormula f, String goalVarName)
     throws Exception {
   HashMap<DialogueKBFormula, DialogueKBFormula> subs =
       new HashMap<DialogueKBFormula, DialogueKBFormula>();
   subs.put(DialogueKBFormula.create(".", null), DialogueKBFormula.create(goalVarName, null));
   return f.substitute(subs);
 }
Пример #2
0
 public static DialogueOperatorEffect createIncrementForVariable(
     String var, DialogueKBFormula increment) throws Exception {
   DialogueKBFormula varf = DialogueKBFormula.create(var, null);
   Collection<DialogueKBFormula> args = new ArrayList<DialogueKBFormula>();
   args.add(varf);
   args.add(increment);
   DialogueKBFormula incf = DialogueKBFormula.create("+", args);
   return DialogueOperatorEffect.createAssignment(varf, incf, false);
 }
Пример #3
0
 public static DialogueOperatorEffect createIncrementForVariable(String var, Number val)
     throws Exception {
   DialogueKBFormula increment = DialogueKBFormula.create(val + "", null);
   return DialogueOperatorEffect.createIncrementForVariable(var, increment);
 }
Пример #4
0
 public static DialogueOperatorEffect createAssignment(String varName, Object value)
     throws Exception {
   return createAssignment(DialogueKBFormula.create(varName, null), value, true);
 }