64 std::string msg =
"The following property does not exists: ";
76 const std::string& byDefault)
const {
82 std::vector< std::string > prop;
98 for (
const auto node:
nodes()) {
99 dSize += std::log10(
variable(node).domainSize());
109 for (
const auto node:
nodes())
120 std::vector< std::string > res;
122 std::transform(
ids.cbegin(),
ids.cend(), std::back_inserter(res), [v](
NodeId n) {
131 std::vector< std::string > res;
133 res.push_back(v.
name(n));
140 std::vector< NodeId > res;
142 std::transform(
names.cbegin(),
144 std::back_inserter(res),
145 [v](
const std::string& n) { return v.idFromName(n); });
153 for (
const auto& name: l) {
163 for (
const auto& node: l) {
const HashTable< std::string, std::string > & _properties_() const
Return the properties of this Directed Graphical Model.
virtual const DiscreteVariable & variable(NodeId id) const =0
Returns a constant reference over a variable given it's node id.
void setProperty(const std::string &name, const std::string &value)
Add or change a property of this GraphicalModel.
virtual const VariableNodeMap & variableNodeMap() const =0
Returns a constant reference to the VariableNodeMap of this Graphical Model.
HashTable< std::string, std::string > _propertiesMap_
The properties of this Directed Graphical Model.
const std::string & property(const std::string &name) const
Return the value of the property name of this GraphicalModel.
const std::string & propertyWithDefault(const std::string &name, const std::string &byDefault) const
Return the value of the property name of this GraphicalModel.
std::vector< NodeId > ids(const std::vector< std::string > &names) const
transform a vector of names into a vector of nodeId
virtual const NodeGraphPart & nodes() const =0
Returns a constant reference to the VariableNodeMap of this Graphical Model.
std::vector< std::string > names(const std::vector< NodeId > &ids) const
transform a vector of NodeId in a vector of names
gum::VariableSet variables(const std::vector< std::string > &l) const
transform a vector of names into a VariableeSet
double log10DomainSize() const
std::vector< std::string > properties() const
List of all the properties.
Instantiation completeInstantiation() const
Get an instantiation over all the variables of the model.
virtual bool empty() const
Return true if this graphical model is empty.
virtual Size size() const =0
Returns the number of variables in this Directed Graphical Model.
Class for assigning/browsing values to tuples of discrete variables.
Exception : the element we looked for cannot be found.
void insert(const Key &k)
Inserts a new element into the set.
Container used to map discrete variables with nodes.
const DiscreteVariable & variableFromName(const std::string &name) const
const DiscreteVariable & get(NodeId id) const
Returns a discrete variable given it's node id.
const std::string & name(NodeId id) const
Returns the name of a variable given its id.
#define GUM_ERROR(type, msg)
Class representing probabilistic DAG model.
Size NodeId
Type for node ids.
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
gum is the global namespace for all aGrUM entities
Set< const DiscreteVariable * > VariableSet