Ejemplo n.º 1
0
        public static object CallResult(ICallable callable, object value, int maxtime, double exitscore)
        {
            QueueArena arena = new QueueArena();
            BestContinuation getbest = new BestContinuation();
            LastFailure getlast = new LastFailure();

            arena.Call(callable, 100.0, value, getbest.GetContinue(), getlast.GetFail());

            while (getbest.Salience <= exitscore && !arena.IsEmpty)
                arena.EvaluateOne();

            if (getbest.Value == null && getlast.Reason != null)
                return new Exception(getlast.Reason);

            return getbest.Value;
        }
Ejemplo n.º 2
0
 public Continuation(BestContinuation parent)
 {
     this.parent = parent;
 }