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; }
public Failure(LastFailure parent) { this.parent = parent; }