Fawkes API  Fawkes Development Version
domain_action.h
1 
2 /***************************************************************************
3  * domain_action.h - stn-generator
4  *
5  * Created: Sat May 6 20:16:21 2017
6  * Copyright 2017 Matthias Loebach
7  ****************************************************************************/
8 
9 /* This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU Library General Public License for more details.
18  *
19  * Read the full text in the LICENSE.GPL file in the doc directory.
20  */
21 
22 #ifndef PLUGINS_DOMAIN_ACTION_H_
23 #define PLUGINS_DOMAIN_ACTION_H_
24 
25 #include "predicate.h"
26 #include "stn_action.h"
27 
28 #include <algorithm>
29 #include <iostream>
30 #include <iterator>
31 #include <map>
32 #include <sstream>
33 #include <string>
34 #include <vector>
35 
36 namespace fawkes {
37 namespace stn {
38 
40 {
41 public:
42  DomainAction(const std::string & name,
43  const std::vector<std::string> &params,
44  const std::vector<Predicate> & preconds,
45  const std::vector<Predicate> & effects,
46  int duration = 0,
47  const std::vector<std::string> &cond_breakups = {},
48  const std::vector<std::string> &temp_breakups = {});
49  virtual ~DomainAction(){};
50 
51  const std::string getName();
52  const std::vector<std::string> params();
53  StnAction generateStnAction(const std::string &name, const std::string &params);
54 
55 private:
56  friend std::ostream & operator<<(std::ostream &, const DomainAction &);
57  std::string name_;
58  std::vector<std::string> params_;
59  std::vector<Predicate> preconds_;
60  std::vector<Predicate> effects_;
61  int duration_;
62  std::vector<std::string> cond_breakups_;
63  std::vector<std::string> temp_breakups_;
64 };
65 
66 } // namespace stn
67 } // namespace fawkes
68 #endif
A representation of an action used by the STN generator.
Definition: domain_action.h:40
const std::vector< std::string > params()
Get the list of parameters of the action.
friend std::ostream & operator<<(std::ostream &, const DomainAction &)
Print a DomainAction.
StnAction generateStnAction(const std::string &name, const std::string &params)
Generate an StnAction from the DomainAction.
DomainAction(const std::string &name, const std::vector< std::string > &params, const std::vector< Predicate > &preconds, const std::vector< Predicate > &effects, int duration=0, const std::vector< std::string > &cond_breakups={}, const std::vector< std::string > &temp_breakups={})
Constructor.
const std::string getName()
Get the name of the action.
An action representation within an STN.
Definition: stn_action.h:41
Fawkes library namespace.