Changeset 732 for cpp/frams/genetics/f1


Ignore:
Timestamp:
02/15/18 00:42:07 (7 years ago)
Author:
Maciej Komosinski
Message:

Added support for "checkpoints" (intermediate phases of development of the Model when converting between genetic encodings). See Model.checkpoint() and conv_f1.cpp for an example.

Location:
cpp/frams/genetics/f1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/f1/conv_f1.cpp

    r726 r732  
    11// This file is a part of Framsticks SDK.  http://www.framsticks.com/
    2 // Copyright (C) 1999-2017  Maciej Komosinski and Szymon Ulatowski.
     2// Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
    33// See LICENSE.txt for details.
    44
     
    1414
    1515F1Props stdprops = { 1, 0, 1, 0.4, 0.25, 0.25, 0.25, 0.25, 0.0, 1.0, 1.0, 1,
    16         0.2, 0.5, 0.5, 0.5 };
     160.2, 0.5, 0.5, 0.5 };
    1717
    1818class Builder
     
    106106
    107107/** main conversion function - with conversion map support */
    108 SString GenoConv_f1::convert(SString &i, MultiMap *map)
     108SString GenoConv_f1::convert(SString &i, MultiMap *map, bool using_checkpoints)
    109109{
    110110        const char* g = i.c_str();
    111111        Builder builder(g, map ? 1 : 0);
    112         builder.model.open();
     112        builder.model.open(using_checkpoints);
    113113        builder.grow(-1, g, Pt3D_0, stdprops, -1); // uses Model::addFromString() to create model elements
    114114        if (builder.invalid) return SString();
     
    242242
    243243                        if (c.muscle_reset_range) c.muscle_bend_range = 1.0; else c.muscle_reset_range = true;
     244                        model.checkpoint();
    244245                        grow(part2, g + 1, Pt3D_0, c, branching_part);
    245246                        return;
  • cpp/frams/genetics/f1/conv_f1.h

    r671 r732  
    11// This file is a part of Framsticks SDK.  http://www.framsticks.com/
    2 // Copyright (C) 1999-2017  Maciej Komosinski and Szymon Ulatowski.
     2// Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
    33// See LICENSE.txt for details.
    44
     
    6969                mapsupport = 1;
    7070        }
    71         SString convert(SString &i, MultiMap *map);
     71        SString convert(SString &i, MultiMap *map, bool using_checkpoints);
    7272        ~GenoConv_f1() {}
    7373};
Note: See TracChangeset for help on using the changeset viewer.