package at.oefai.aaa.agent.jam;


/**
 * A built-in JAM construct for conditionally delayed execution.
 * @author Marc Huber
 */

class PlanWaitConstruct implements PlanConstruct {

    private Action action;
    private Relation rel;

    /** Wait on successful completion of an action. */
    PlanWaitConstruct(final Action a) {
        this.action = a;
        this.rel = null;
    }

    /** Wait for a goal relation to be achieved. */
    PlanWaitConstruct(final Relation r) {
        this.action = null;
        this.rel = r;
    }


    // Member functions

    public Action getAction() { return this.action; }

    public Relation getRelation() { return this.rel; }

    /** Construct an appropriate RuntimeState. */
    public PlanRuntimeState newRuntimeState() {
        return new PlanRuntimeWaitState(this);
    }

}

