come compilare: g++ prova.cpp -lboost_system -liSpike

compila senza errori,

metto un file di testo “prova.txt” con questo contenuto (legge un solo valore alla volta dal file) uno ogni ms.

54
#include <iostream>
#include <iSpike/Reader/FileAngleReader.hpp>
#include <iSpike/Channel/InputChannel/JointInputChannel.hpp>
#include <map>
 
int main() 
{
 
    std::cout << "prova";
    ispike::FileAngleReader* far = new ispike::FileAngleReader();
    map<string,ispike::Property> farp = far->getProperties();
    farp.at("File Name") = ispike::Property("prova.txt", "File Name", "description", true);
 
    far->initialize(farp);
 
    ispike::JointInputChannel* jc = new ispike::JointInputChannel();
    map<string,ispike::Property> jcp = jc->getProperties();
    //jcp.at("minAngle") = ispike::Property(ispike::Property::Double, 10, "Minimum Angle", "description", true);
    jc->initialize(far, jcp);

output

2015-Jul-22 23:12:59 Info: 0:      FileAngleReader: Reading angles from: prova.txt
2015-Jul-22 23:12:59 Info: 1:      FileAngleReader: Read the following angles: 54
2015-Jul-22 23:12:59 Debug: 2:     Initializing neuron simulator with 10 neurons.

togliendo il commento alla riga in fondo si ottiene

terminate called after throwing an instance of 'std::out_of_range'
what():  map::at
Aborted
  • neurali/ispike_esempio1.txt
  • Last modified: 2018/04/25 07:55
  • (external edit)