Fawkes API Fawkes Development Version
effect_visitor.h
1/***************************************************************************
2 * effect_visitor.h - A static visitor to translate an effect
3 *
4 * Created: Tue 31 Oct 2017 12:39:10 CET 12:39
5 * Copyright 2017 Till Hofmann <hofmann@kbsg.rwth-aachen.de>
6 ****************************************************************************/
7
8/* This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Library General Public License for more details.
17 *
18 * Read the full text in the LICENSE.GPL file in the doc directory.
19 */
20
21#ifndef _PLUGINS_CLIPS_PDDL_PARSER_EFFECT_VISITOR_H_
22#define _PLUGINS_CLIPS_PDDL_PARSER_EFFECT_VISITOR_H_
23
24#include <pddl_parser/pddl_parser.h>
25
26#include <boost/variant/variant.hpp>
27#include <string>
28#include <vector>
29
30class EffectToCLIPSFactVisitor : public boost::static_visitor<std::vector<std::string>>
31{
32public:
33 EffectToCLIPSFactVisitor(const std::string &pddl_operator, bool positive);
34 std::vector<std::string> operator()(pddl_parser::Atom &a) const;
35 std::vector<std::string> operator()(pddl_parser::Predicate &p) const;
36 std::vector<std::string> operator()(pddl_parser::QuantifiedFormula &q) const;
37
38private:
39 std::string pddl_operator_;
40 bool positive_effect_;
41};
42
43#endif /* !PLUGINS_CLIPS_PDDL_PARSER_EFFECT_VISITOR_H__ */
Translate a PDDL effect into CLIPS facts.
std::vector< std::string > operator()(pddl_parser::Atom &a) const
Translate an Atom into a vector of strings.
EffectToCLIPSFactVisitor(const std::string &pddl_operator, bool positive)
Constructor.
A PDDL formula (either part of a precondition or an effect(.
Definition: pddl_ast.h:107
A PDDL quantified formula.
Definition: pddl_ast.h:89