creativity
v1.3.0
Agent-based model of creativity and piracy
|
Wrapper class around a simple column, where values are exactly the value in the column. More...
#include <creativity/data/Variable.hpp>
Public Member Functions | |
virtual void | populate (Eigen::Ref< Eigen::VectorXd > column, unsigned int offset=0, unsigned int trim=0) const override |
Copies the source column values into column | |
virtual std::string | name () const override |
Returns the name given during construction. | |
virtual std::string | nameBracketed (const std::string &="(", const std::string &=")") const override |
Overridden to not bracket the name. | |
unsigned int | size () const override |
Returns the size of the underlying data column. | |
![]() | |
virtual | ~Variable ()=default |
Virtual destructor. | |
Eigen::VectorXd | values (unsigned int rows=0, unsigned int offset=0, unsigned int trim=0) const |
Shortcut wrapper around populate that creates a new column of the given size, calls populate() with it, then returns it. More... | |
Static Public Member Functions | |
template<class... Args> | |
static std::shared_ptr< SimpleVariable > | create (Args... args) |
Forwards arguments to the protected constructor and returns a shared_ptr to the created object. | |
Protected Member Functions | |
SimpleVariable ()=delete | |
Not default constructible. | |
SimpleVariable (const std::string &name, const Eigen::Ref< const Eigen::VectorXd > values) | |
Constructs a SimpleVariable that copies values from the given Vector. | |
Protected Attributes | |
const std::string | name_ |
The name of this variable. | |
Eigen::VectorXd | col_ |
The column of values. | |
Wrapper class around a simple column, where values are exactly the value in the column.