.. _program_listing_file_src_VALfiles_Events.h: Program Listing for File Events.h ================================= |exhale_lsh| :ref:`Return to documentation for file ` (``src/VALfiles/Events.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /************************************************************************ * Copyright 2008, Strathclyde Planning Group, * Department of Computer and Information Sciences, * University of Strathclyde, Glasgow, UK * http://planning.cis.strath.ac.uk/ * * Maria Fox, Richard Howey and Derek Long - VAL * Stephen Cresswell - PDDL Parser * * This file is part of VAL, the PDDL validator. * * VAL is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * VAL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with VAL. If not, see . * ************************************************************************/ /*----------------------------------------------------------------------------- VAL - The Automatic Plan Validator for PDDL+ $Date: 2010-06-16 14:45:08 $ $Revision: 1.3 $ Maria Fox, Richard Howey and Derek Long - PDDL+ and VAL Stephen Cresswell - PDDL Parser maria.fox@cis.strath.ac.uk derek.long@cis.strath.ac.uk stephen.cresswell@cis.strath.ac.uk richard.howey@cis.strath.ac.uk By releasing this code we imply no warranty as to its reliability and its use is entirely at your own risk. Strathclyde Planning Group http://planning.cis.strath.ac.uk ----------------------------------------------------------------------------*/ #include #include "State.h" #include "Action.h" #include "Plan.h" #include using std::vector; #ifndef __EVENTS #define __EVENTS namespace VAL { class Events{ private: vector ungroundEvents; vector ungroundProcesses; set triggeredEvents; //triggered events at a given time point set triggeredProcesses; //triggered processes at a given time point set untriggeredProcesses; //untriggered processes at a given time point //active processes map > activeProcesses; vector eventsForMutexCheck; //these are actions that are triggered the same time as an action, stored here for extra mutex checks //to be deleted after plan is complete vector oldTriggeredEvents; double lastHappeningTime; bool ctsEventTriggered; public: Events(const operator_list * ops); ~Events(); string getName(operator_ * op,const_symbol_list * csl) const; vector getTriggeredEvents() const {return oldTriggeredEvents;}; bool triggerInitialEvents(Validator * v,double firstHappeningTime); bool triggerEventsOnInterval(Validator * v,bool init); bool triggerDiscreteEvents(Validator * v,bool init); bool triggerDiscreteProcesses(Validator * v); bool triggerContinuousEvents(Validator * v,bool init); bool hasEvents() const {return (!(ungroundEvents.empty()) || !(ungroundProcesses.empty()));}; bool isTriggered(event * eve,const_symbol_list * csl) const; bool isProcessActive(process * pro,const_symbol_list * csl) const; bool isTriggered(const Action * act) const; bool isProcessTriggered(const StartAction * sa) const; bool isProcessUntriggered(process * pro,const_symbol_list * csl) const; void updateHappeningTime(double t); void updateEventsForMutexCheck(Validator * v); const vector & getEventsForMutexCheck() const {return eventsForMutexCheck;}; }; bool checkPreconditionsAreNotSatisfied(const State * s,const vector & events); const vector getParametersDiscreteInitialFinal(goal * g,operator_ * op,Validator * v); const vector getParametersDiscreteFinal(goal * g,operator_ * op, const State & s); const vector getParametersCtsFinal(goal * g,operator_ * op,Validator * v); const vector getParametersDiscrete(goal * g,operator_ * op, const State & s,bool neg = false); const vector getParametersCts(goal * g,operator_ * op,Validator * v,bool neg = false,bool atAPoint = false); const vector getParameters(goal * g,operator_ * op,Validator * v,bool discrete,bool neg = false,bool atAPoint = false); const vector getParametersList(goal * g,operator_ * op,Validator * v,const vector & lop,bool neg,bool discrete,bool atAPoint = false); const vector defineUndefinedParameters(const_symbol_list * csl,var_symbol_list* variables,Validator * vld,const set & svs); const vector defineUndefinedParameters(const vector & vcsl,operator_ * op,Validator * vld,const set & svs); const vector defineUndefinedParametersPropVar(const_symbol_list * csl,operator_ * op,Validator * vld,goal * g,bool dp,bool neg,const set & svs,bool compError = false); const vector defineUndefinedParametersPropVar(const vector & vcsl,operator_ * op,Validator * vld,goal * g,bool dp,bool neg,const set & svs,bool compError = false); const vector checkParametersProp(const vector & vcsl,operator_ * op,Validator * vld,goal * g,bool neg,bool dp,bool compError = false); string getParameter(const SimpleProposition * sp,var_symbol * vs,const simple_goal * sg); string getParameter(const FuncExp * fe,var_symbol * vs,const func_term * pne); bool undefinedParameterExists(const_symbol_list * csl); const vector removeRepeatedParameters(const vector & vcsl); void getPNEs(const expression * e,set & pnes); const set getVariables(const expression * e); const set getVariables(const simple_goal * sg); const set getVariables(const qfied_goal * qg); const set getVariables(const operator_ * op); void addToListOfParameters(vector & vcsl,const vector & lop,const_symbol_list * csl); const expression * copyExpression(const expression * e); const goal * copyGoal(const goal * g); const vector getCopyCSL(const vector & lop); void deleteParameters(vector & vcsl); const_symbol_list * newBlankConstSymbolList(var_symbol_list * parameters,Validator * v); }; #endif