Adds file-is-there check
This commit is contained in:
parent
db9bba79ac
commit
6e2d55b6d7
1 changed files with 5 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
||||||
#define ATTRACTOR_HPP
|
#define ATTRACTOR_HPP
|
||||||
|
|
||||||
#include "Logger.hpp"
|
#include "Logger.hpp"
|
||||||
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
@ -17,7 +18,10 @@ public:
|
||||||
LogInfo("Reading file '%s'...\n", filename.c_str());
|
LogInfo("Reading file '%s'...\n", filename.c_str());
|
||||||
|
|
||||||
stfu::node system;
|
stfu::node system;
|
||||||
system.read(filename.c_str());
|
if(!system.read(filename.c_str())){
|
||||||
|
std::cerr << "Couldn't open file(" << filename << ") for reading\n";
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
kernel = AttractorKernel::createAttractorKernel(system.getChild("AttractorKernel"));
|
kernel = AttractorKernel::createAttractorKernel(system.getChild("AttractorKernel"));
|
||||||
projector = Projector::createProjector(system.getChild(system.getValue("Projector")), kernel->getDimension());
|
projector = Projector::createProjector(system.getChild(system.getValue("Projector")), kernel->getDimension());
|
||||||
|
|
Reference in a new issue