20 #ifndef VARIABLEVALUES_H 21 #define VARIABLEVALUES_H 29 template <>
struct is_map<
minsky::ConstMap<std::string, minsky::VariableValue> >:
public is_map_map {};
35 typedef std::shared_ptr<Group>
GroupPtr;
57 emplace(
"constant:zero",
zero());
58 emplace(
"constant:one",
one());
61 std::string
newName(
const std::string& name)
const;
72 std::set<std::string> visited;
77 std::vector<Summary> summary;
79 summary.emplace_back(v.second->summary());
87 i.second->unitsCached=
false;
95 struct is_associative_container<
minsky::ConstMap<std::string, minsky::VariableValue> >:
public classdesc::true_type {};
97 template <>
struct is_smart_ptr<
minsky::VariableValuePtr>:
public true_type {};
100 #include "variableValues.cd" std::string newName(const std::string &name) const
generate a new valueId not otherwise in the system
TensorVal initValue(const VariableValue &, std::set< std::string > &visited) const
evaluates the initial value of a given variableValue in the context given by this. visited is used to check for circular definitions
std::vector< Summary > summarise() const
bool validEntries() const
checks that all entry names are valid
void resetValue(VariableValue &) const
reset a give variable value to it's initial condition, in this context
void reset()
reset all variableValues to their initial conditions
size_t scope(const string &name)
extract scope from a qualified variable name
a shared_ptr that default constructs a default target, and is always valid
VariableValuePtr(VariableType::Type type, const VariableValue &vv)
TensorVal initValue(const VariableValue &v) const
Creation and access to the minskyTCL_obj object, which has code to record whenever Minsky's state cha...
static VariableValuePtr & one()
std::shared_ptr< Group > GroupPtr
VariableValuePtr(VariableType::Type type=VariableType::undefined, const std::string &name="", const GroupPtr &group=GroupPtr())
VariableValuePtr(const std::shared_ptr< VariableValue > &x)
static VariableValuePtr & zero()
CLASSDESC_ACCESS(VariableValues)