UNPKG

mahler

Version:

A automated task composer and HTN based planner for building autonomous system agents

56 lines 1.65 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UnknownError = exports.Timeout = exports.Failure = exports.Stopped = exports.NotStarted = void 0; /** * This error is returned by the wait method * if the agent has not been given a target to seek yete */ class NotStarted extends Error { constructor() { super('Agent has not been started yet'); } } exports.NotStarted = NotStarted; /** * Returned by the agent runtime if a new target has been * received, causing the runtime to be stopped */ class Stopped extends Error { constructor() { super('Agent was stopped before a plan could be found'); } } exports.Stopped = Stopped; /** * Returned by the agent runtime if the target was not reached within * the maximum configured number of tries */ class Failure extends Error { tries; constructor(tries) { super('Agent failed to reach target after ' + tries + ' attempts'); this.tries = tries; } } exports.Failure = Failure; /** * Returned by the Agent.wait method if the agent ddoes not yield a * result within the given timeout */ class Timeout extends Error { constructor(timeout) { super(`Agent timed out after ${timeout}(ms) while waiting for a result`); } } exports.Timeout = Timeout; /** * Returned by the runtime if the plan search of execution fails due to an * unknown cause. This probably means there is a bug. */ class UnknownError extends Error { constructor(cause) { super('Agent panicked due to unknown error', { cause }); } } exports.UnknownError = UnknownError; //# sourceMappingURL=types.js.map