My old project for strange attractors
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

47 lines
1.1 KiB

#include "Attractor.hpp"
#include "Logger.hpp"
#include <cstdlib>
#include "stfu/stf.hpp"
#include "AttractorKernel.hpp"
#include "Projector.hpp"
Attractor::Attractor()
: projector(0)
, kernel(0)
{
stfu::node kernel_node;
switch(rand()%2+1){
case 0:
kernel_node.value("type") = "lorenz";
kernel_node.value("dimensions") = "3";
break;
14 years ago
/*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');
14 years ago
break;*/
case 1:
kernel_node.value("type") = "polynomial a";
kernel_node.value("dimensions") = "3";
break;
14 years ago
/*case 3:
kernel_node.value("type") = "logistic";
kernel_node.value("dimensions") = std::string() + (char)(rand()%3 + '2');
14 years ago
break;*/
case 2:
kernel_node.value("type") = "unravel";
kernel_node.value("dimensions") = "3";
break;
}
kernel = AttractorKernel::createAttractorKernel(kernel_node);
kernel->generate_random_parameters();
stfu::node projector_node;
projector = Projector::createProjector(projector_node, kernel->getDimension());
}