|
|
@ -2,6 +2,7 @@ |
|
|
|
|
|
|
|
#include "Logger.hpp" |
|
|
|
#include <fstream> |
|
|
|
#include <iostream> |
|
|
|
#include <cstdlib> |
|
|
|
#include <string> |
|
|
|
#include "stfu/stf.hpp" |
|
|
@ -18,7 +19,7 @@ Attractor::Attractor(const std::string& filename) : kernel(0), projector(0) { |
|
|
|
system.read(filename.c_str()); |
|
|
|
|
|
|
|
kernel = AttractorKernel::createAttractorKernel(system.getChild("AttractorKernel")); |
|
|
|
projector = Projector::createProjector(system.getChild(system.getValue("Projector")), system); |
|
|
|
projector = Projector::createProjector(system.getChild(system.getValue("Projector")), kernel->getDimension()); |
|
|
|
} |
|
|
|
|
|
|
|
Attractor::Attractor(){ |
|
|
@ -31,6 +32,7 @@ Attractor::Attractor(){ |
|
|
|
case 1: |
|
|
|
kernel_node.value("type") = "polynomial"; |
|
|
|
kernel_node.value("dimensions") = std::string() + (char)(rand()%3 + '2'); |
|
|
|
kernel_node.value("orde") = std::string() + (char)(rand()%5 + '1'); |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
kernel_node.value("type") = "polynomial a"; |
|
|
@ -46,12 +48,17 @@ Attractor::Attractor(){ |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
std::cout << kernel_node << std::endl; |
|
|
|
|
|
|
|
kernel = AttractorKernel::createAttractorKernel(kernel_node); |
|
|
|
kernel->generate_random_parameters(); |
|
|
|
|
|
|
|
stfu::node projector_node; |
|
|
|
projector_node.value("dimensions") = "2"; |
|
|
|
|
|
|
|
projector = Projector::createProjector(projector_node, projector_node); |
|
|
|
std::cout << projector_node << std::endl; |
|
|
|
|
|
|
|
projector = Projector::createProjector(projector_node, kernel->getDimension()); |
|
|
|
} |
|
|
|
|
|
|
|
Attractor::~Attractor() { |
|
|
@ -62,8 +69,12 @@ Attractor::~Attractor() { |
|
|
|
// this should probably done in the projector section
|
|
|
|
void Attractor::init_range() { |
|
|
|
// stabilize attractor
|
|
|
|
for(unsigned int i = 0; i < 100000; i++) { |
|
|
|
for(unsigned int i = 0; i < 1000000; i++) { |
|
|
|
iterate(); |
|
|
|
if(kernel->convergent() || kernel->divergent()){ |
|
|
|
kernel->generate_random_parameters(); |
|
|
|
LogDebug("Generating new parameters.\n"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|