![]() |
NuPIC Core
Core algorithms for NuPIC(the Numenta Platform for Intelligent Computing), implemented in C++
|
Represents a set of one or more "identical" nodes in a Network. More...
#include <Region.hpp>
Region information | |
| Network * | getNetwork () |
| Get the network containing this region. More... | |
| const std::string & | getName () const |
| Get the name of the region. More... | |
| const Dimensions & | getDimensions () const |
| Get the dimensions of the region. More... | |
| void | setDimensions (Dimensions &dimensions) |
| Assign width and height to the region. More... | |
Element interface methods | |
| |
| const std::string & | getType () const |
| Get the type of the region. More... | |
| const Spec * | getSpec () const |
| Get the spec of the region. More... | |
| static const Spec * | getSpecFromType (const std::string &nodeType) |
| Get the Spec of a region type without an instance. More... | |
| static void | registerPyRegion (const std::string module, const std::string className) |
| static void | registerCPPRegion (const std::string name, GenericRegisteredRegionImpl *wrapper) |
| static void | unregisterPyRegion (const std::string className) |
| static void | unregisterCPPRegion (const std::string name) |
Parameter getters and setters | |
| Int32 | getParameterInt32 (const std::string &name) const |
Get the parameter as an Int32 value. More... | |
| UInt32 | getParameterUInt32 (const std::string &name) const |
Get the parameter as an UInt32 value. More... | |
| Int64 | getParameterInt64 (const std::string &name) const |
Get the parameter as an Int64 value. More... | |
| UInt64 | getParameterUInt64 (const std::string &name) const |
Get the parameter as an UInt64 value. More... | |
| Real32 | getParameterReal32 (const std::string &name) const |
Get the parameter as an Real32 value. More... | |
| Real64 | getParameterReal64 (const std::string &name) const |
Get the parameter as an Real64 value. More... | |
| Handle | getParameterHandle (const std::string &name) const |
Get the parameter as an Handle value. More... | |
| void | setParameterInt32 (const std::string &name, Int32 value) |
| Set the parameter to an Int32 value. More... | |
| void | setParameterUInt32 (const std::string &name, UInt32 value) |
| Set the parameter to an UInt32 value. More... | |
| void | setParameterInt64 (const std::string &name, Int64 value) |
| Set the parameter to an Int64 value. More... | |
| void | setParameterUInt64 (const std::string &name, UInt64 value) |
| Set the parameter to an UInt64 value. More... | |
| void | setParameterReal32 (const std::string &name, Real32 value) |
| Set the parameter to a Real32 value. More... | |
| void | setParameterReal64 (const std::string &name, Real64 value) |
| Set the parameter to a Real64 value. More... | |
| void | setParameterHandle (const std::string &name, Handle value) |
| Set the parameter to a Handle value. More... | |
| void | getParameterArray (const std::string &name, Array &array) const |
Get the parameter as an Array value. More... | |
| void | setParameterArray (const std::string &name, const Array &array) |
Set the parameter to an Array value. More... | |
| void | setParameterString (const std::string &name, const std::string &s) |
Set the parameter to a std::string value. More... | |
| std::string | getParameterString (const std::string &name) |
Get the parameter as a std::string value. More... | |
| bool | isParameterShared (const std::string &name) const |
| Tells whether the parameter is shared. More... | |
Inputs and outputs | |
| void | prepareInputs () |
| Copies data into the inputs of this region, using the links that are attached to each input. | |
| virtual ArrayRef | getInputData (const std::string &inputName) const |
| Get the input data. More... | |
| virtual ArrayRef | getOutputData (const std::string &outputName) const |
| Get the output data. More... | |
| virtual size_t | getInputCount (const std::string &inputName) const |
| Get the count of input data. More... | |
| virtual size_t | getOutputCount (const std::string &outputName) const |
| Get the count of output data. More... | |
Operations | |
| virtual void | enable () |
| virtual void | disable () |
| virtual std::string | executeCommand (const std::vector< std::string > &args) |
| Request the underlying region to execute a command. More... | |
| void | compute () |
| Perform one step of the region computation. | |
Profiling | |
| void | enableProfiling () |
| Enable profiling of the compute and execute operations. | |
| void | disableProfiling () |
| Disable profiling of the compute and execute operations. | |
| void | resetProfiling () |
| Reset the compute and execute timers. | |
| const Timer & | getComputeTimer () const |
| Get the timer used to profile the compute operation. More... | |
| const Timer & | getExecuteTimer () const |
| Get the timer used to profile the execute operation. More... | |
Represents a set of one or more "identical" nodes in a Network.
Definition at line 71 of file Region.hpp.
|
virtual |
|
virtual |
|
virtual |
Request the underlying region to execute a command.
| args | A list of strings that the actual region will interpret. The first string is the command name. The other arguments are optional. |
| const Timer& nupic::Region::getComputeTimer | ( | ) | const |
Get the timer used to profile the compute operation.
| const Dimensions& nupic::Region::getDimensions | ( | ) | const |
Get the dimensions of the region.
| const Timer& nupic::Region::getExecuteTimer | ( | ) | const |
Get the timer used to profile the execute operation.
|
virtual |
Get the count of input data.
| inputName | The name of the target input |
|
virtual |
Get the input data.
| inputName | The name of the target input |
ArrayRef that contains the input data. | const std::string& nupic::Region::getName | ( | ) | const |
Get the name of the region.
| Network* nupic::Region::getNetwork | ( | ) |
Get the network containing this region.
|
virtual |
Get the count of output data.
| outputName | The name of the target output |
|
virtual |
Get the output data.
| outputName | The name of the target output |
ArrayRef that contains the output data. | void nupic::Region::getParameterArray | ( | const std::string & | name, |
| Array & | array | ||
| ) | const |
Get the parameter as an Array value.
| name | The name of the parameter | |
| [out] | array | The value of the parameter |
array is a memory buffer. If the buffer is allocated, the value is copied into the supplied buffer; otherwise array would be asked to allocate the buffer and copy into it.
A typical use might be that the caller would supply an unallocated buffer on the first call and then reuse the memory buffer on subsequent calls, i.e.
Throws an exception if the supplied array is not big enough.
| Handle nupic::Region::getParameterHandle | ( | const std::string & | name | ) | const |
Get the parameter as an Handle value.
| name | The name of the parameter |
| Int32 nupic::Region::getParameterInt32 | ( | const std::string & | name | ) | const |
Get the parameter as an Int32 value.
| name | The name of the parameter |
| Int64 nupic::Region::getParameterInt64 | ( | const std::string & | name | ) | const |
Get the parameter as an Int64 value.
| name | The name of the parameter |
| Real32 nupic::Region::getParameterReal32 | ( | const std::string & | name | ) | const |
Get the parameter as an Real32 value.
| name | The name of the parameter |
| Real64 nupic::Region::getParameterReal64 | ( | const std::string & | name | ) | const |
Get the parameter as an Real64 value.
| name | The name of the parameter |
| std::string nupic::Region::getParameterString | ( | const std::string & | name | ) |
Get the parameter as a std::string value.
| name | The name of the parameter |
| UInt32 nupic::Region::getParameterUInt32 | ( | const std::string & | name | ) | const |
Get the parameter as an UInt32 value.
| name | The name of the parameter |
| UInt64 nupic::Region::getParameterUInt64 | ( | const std::string & | name | ) | const |
Get the parameter as an UInt64 value.
| name | The name of the parameter |
| const Spec* nupic::Region::getSpec | ( | ) | const |
Get the spec of the region.
|
static |
Get the Spec of a region type without an instance.
| nodeType | A region type as a string |
| const std::string& nupic::Region::getType | ( | ) | const |
Get the type of the region.
| bool nupic::Region::isParameterShared | ( | const std::string & | name | ) | const |
Tells whether the parameter is shared.
| name | The name of the parameter |
Throws an exception if it's not overridden
| void nupic::Region::setDimensions | ( | Dimensions & | dimensions | ) |
Assign width and height to the region.
| dimensions | A Dimensions object that describes the width and height |
| void nupic::Region::setParameterArray | ( | const std::string & | name, |
| const Array & | array | ||
| ) |
Set the parameter to an Array value.
| name | The name of the parameter |
| array | The value of the parameter |
| void nupic::Region::setParameterHandle | ( | const std::string & | name, |
| Handle | value | ||
| ) |
Set the parameter to a Handle value.
| name | The name of the parameter |
| value | The value of the parameter |
| void nupic::Region::setParameterInt32 | ( | const std::string & | name, |
| Int32 | value | ||
| ) |
Set the parameter to an Int32 value.
| name | The name of the parameter |
| value | The value of the parameter |
| void nupic::Region::setParameterInt64 | ( | const std::string & | name, |
| Int64 | value | ||
| ) |
Set the parameter to an Int64 value.
| name | The name of the parameter |
| value | The value of the parameter |
| void nupic::Region::setParameterReal32 | ( | const std::string & | name, |
| Real32 | value | ||
| ) |
Set the parameter to a Real32 value.
| name | The name of the parameter |
| value | The value of the parameter |
| void nupic::Region::setParameterReal64 | ( | const std::string & | name, |
| Real64 | value | ||
| ) |
Set the parameter to a Real64 value.
| name | The name of the parameter |
| value | The value of the parameter |
| void nupic::Region::setParameterString | ( | const std::string & | name, |
| const std::string & | s | ||
| ) |
Set the parameter to a std::string value.
| name | The name of the parameter |
| s | The value of the parameter |
Strings are handled internally as Byte Arrays, but this interface is clumsy. setParameterString() and getParameterString() internally use byte arrays but converts to/from strings.
setParameterString() is implemented with one copy (from the string into the node) but getParameterString() requires a second copy so that there are temporarily three copies of the data in memory (in the node, in an internal Array object, and in the string returned to the user)
| void nupic::Region::setParameterUInt32 | ( | const std::string & | name, |
| UInt32 | value | ||
| ) |
Set the parameter to an UInt32 value.
| name | The name of the parameter |
| value | The value of the parameter |
| void nupic::Region::setParameterUInt64 | ( | const std::string & | name, |
| UInt64 | value | ||
| ) |
Set the parameter to an UInt64 value.
| name | The name of the parameter |
| value | The value of the parameter |
1.8.3.1