source: cpp/frams/genetics/f4/f4_conv.h @ 1279

Last change on this file since 1279 was 1249, checked in by Maciej Komosinski, 19 months ago

Multiple issues fixed when calculating bending range for the '|' bending muscle (earlier it was always 1.0 despite the code that supposedly calculated this)

  • Property svn:eol-style set to native
File size: 2.5 KB
RevLine 
[286]1// This file is a part of Framsticks SDK.  http://www.framsticks.com/
2// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
3// See LICENSE.txt for details.
[193]4
[196]5// Copyright (C) 1999,2000  Adam Rotaru-Varga (adam_rotaru@yahoo.com), GNU LGPL
6// Copyright (C) since 2001 Maciej Komosinski
[1238]7// 2018, Grzegorz Latosinski, added development checkpoints and support for new API for neuron types
[196]8
[779]9#ifndef _F4_CONV_H_
10#define _F4_CONV_H_
[193]11
[196]12#include <frams/model/model.h>
13#include <frams/model/modelparts.h>
14#include <frams/genetics/genoconv.h>
[193]15#include "f4_general.h"
16
17
[760]18/**
19 * Genotype converter from f4 to f0.
20 */
[196]21class GenoConv_f40 : public GenoConverter
[193]22{
[196]23public:
24        GenoConv_f40();
[760]25
26        /**
27         * Performs conversion from f4 to f0. Creates f4_Model from f4 genotype
28         * and converts the Model to the f0 genotype string.
29         * @param in f4 genotype
30         * @param map mapping from f4 to Model
31         * @param using_checkpoints determines if checkpoints will be available
32         * @return generated f0 genotype
33         */
[774]34        SString convert(SString &in, MultiMap *map, bool using_checkpoints);
[193]35};
36
37
[760]38/**
39 * Genotype converter from f4 to f1. This is only experimental conversion and
40 * returns an approximate f1 genotype.
41 */
[196]42class GenoConv_F41_TestOnly : public GenoConverter
[193]43{
[196]44public:
[760]45        /**
46         * Initializes converter.
47         */
[196]48        GenoConv_F41_TestOnly();
[760]49
50        /**
51         * Performs conversion from f4 to f1. Creates f4_Model from f4 genotype
52         * and converts the Model to the f1 genotype string. The final f1 genotype is
53         * an approximation.
54         * @param in f4 genotype
55         * @param map mapping from f4 to Model
56         * @param using_checkpoints determines if checkpoints will be available
57         * @return generated approximate f1 genotype
58         */
[774]59        SString convert(SString &in, MultiMap *map, bool using_checkpoints);
[193]60};
61
62
[760]63/**
64 * A Model descendant which supports building from an f4 genotype.
65 */
[196]66class f4_Model : public Model
[193]67{
[196]68public:
69        f4_Model();
70        ~f4_Model();
[760]71
72        /**
73         * Builds a Model from the f4 genotype string.
74         * @param geno genotype string
75         * @return GENOPER_OK if a Model could be created, error code otherwise
76         */
77        int      buildFromF4(SString &geno, bool using_checkpoints);
78        /**
79         * Outputs a Model in f1 format. It is an approximation of the input f4 genotype.
80         * @param out the reference that stores the conversion result
81         */
[196]82        void     toF1Geno(SString &out);       // output to f1 format, approximation
83private:
[774]84        f4_Cells *cells;
[1249]85        int        buildModelRecur(f4_Cell *ndad);
[196]86        /**
87         * Get a cell which is a stick, by traversing dadlinks.
88         */
[774]89        f4_Cell* getStick(f4_Cell *C);
[196]90        int        error;
91        int        errorpos;
[193]92};
93
94
95#endif
Note: See TracBrowser for help on using the repository browser.