示例#1
0
 public GetBread(EvaluationTree parentEvalTree) : base(parentEvalTree)
 {
     actionValue       = 80;
     typeOfAction      = UtilityType.GET_BREAD;
     name              = "Getting Food";
     currentActionName = "Heading to Bread";
 }
 public MakeBread(EvaluationTree parentEvalTree) : base(parentEvalTree)
 {
     actionValue       = 70;
     typeOfAction      = UtilityType.MAKE_BREAD;
     name              = "Making Bread";
     currentActionName = "Making Bread";
 }
        private static Function createArcsinFunction()
        {
            Declaration    declaration = new Declaration("arcsin(x)");
            EvaluationNode node        = new ArcsinNode();
            EvaluationTree tree        = new EvaluationTree(node);

            return(new Function(declaration, tree));
        }
        private static Function createLogFunction()
        {
            Declaration    declaration = new Declaration("log(x)");
            EvaluationNode node        = new LogNode();
            EvaluationTree tree        = new EvaluationTree(node);

            return(new Function(declaration, tree));
        }
        private static Function createCosFunction()
        {
            Declaration    declaration = new Declaration("cos(x)");
            EvaluationNode node        = new CosNode();
            EvaluationTree tree        = new EvaluationTree(node);

            return(new Function(declaration, tree));
        }
示例#6
0
 public Function(string function)
 {
     this.function = function;
     if (isValidFunction())
     {
         this.declaration    = parseDeclaration();
         this.evaluationTree = parseExpression();
         addFunctionToNameSpace();
     }
     else
     {
         throw new Exception();
     }
 }
 public HandleHunger(EvaluationTree parentEvalTree) : base(parentEvalTree)
 {
     actionValue       = 10;
     name              = "Handling Hunger";
     currentActionName = "Hungry, thinking about food";
 }
示例#8
0
 public GoToSleep(EvaluationTree parentEvalTree) : base(parentEvalTree)
 {
 }
 public HandleSleep(EvaluationTree parentEvalTree) : base(parentEvalTree)
 {
     typeOfAction      = UtilityType.GETTING_SLEEP;
     name              = "Trying To Get Sleep";
     currentActionName = "Thinking About Sleep";
 }
示例#10
0
 public Function(Declaration declaration, EvaluationTree tree)
 {
     this.evaluationTree = tree;
     this.declaration    = declaration;
 }
示例#11
0
 public FunctionNode(Function function, EvaluationTree evaluationTree) : base(EvaluationNodeType.FUNCTION)
 {
     this.function       = function;
     this.evaluationTree = evaluationTree;
 }
 public WatchTV(EvaluationTree parentEvalTree) : base(parentEvalTree)
 {
     actionValue = 40;
     name        = "Bored, want to watch TV";
 }
 public BehaviorSnippet(EvaluationTree parentEvalTree)
 {
     evalTree  = parentEvalTree;
     bDS       = evalTree.bds;
     charStats = bDS.charStats;
 }