Ignore:
Timestamp:
03/25/14 03:22:37 (10 years ago)
Author:
Maciej Komosinski
Message:

Updated f4 sources and made f4 available for GDK demo apps

Location:
cpp/frams/genetics/f4
Files:
1 added
1 moved

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/f4/conv_f4.h

    r193 r196  
    1 /**
    2  *  conv_f4.h - f4 conversion functions.
    3  *
    4  *  f4genotype - f4 format genotype conversions for FramSticks
    5  *
    6  *  Copyright (C) 1999,2000  Adam Rotaru-Varga (adam_rotaru@yahoo.com)
    7  *  Copyright (C) 2001-2003  Maciej Komosinski
    8  *
    9  *  This library is free software; you can redistribute it and/or
    10  *  modify it under the terms of the GNU Lesser General Public
    11  *  License as published by the Free Software Foundation; either
    12  *  version 2.1 of the License, or (at your option) any later version.
    13  *
    14  *  This library is distributed in the hope that it will be useful,
    15  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    16  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    17  *  Lesser General Public License for more details.
    18  *
    19  *  You should have received a copy of the GNU Lesser General Public
    20  *  License along with this library; if not, write to the Free Software
    21  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
    22  *
    23  */
     1// This file is a part of the Framsticks GDK.
     2// Copyright (C) 2002-2014  Maciej Komosinski and Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
     4
     5// Copyright (C) 1999,2000  Adam Rotaru-Varga (adam_rotaru@yahoo.com), GNU LGPL
     6// Copyright (C) since 2001 Maciej Komosinski
    247
    258#ifndef _CONV_F4_H_
    269#define _CONV_F4_H_
    2710
    28 #include "model.h"
    29 #include "modelparts.h"
    30 #include "genoconv.h"
     11#include <frams/model/model.h>
     12#include <frams/model/modelparts.h>
     13#include <frams/genetics/genoconv.h>
    3114#include "f4_general.h"
    3215
    3316
    3417// The f4->f0 converter
    35 class GenoConv_F40: public GenoConverter
     18class GenoConv_f40 : public GenoConverter
    3619{
    37  public:
    38   GenoConv_F40();
    39   SString convert(SString &in, MultiMap * map);
     20public:
     21        GenoConv_f40();
     22        SString convert(SString &in, MultiMap * map);
    4023};
    4124
    4225
    4326// a test-only f4->f1 converter, approximates only
    44 class GenoConv_F41_TestOnly: public GenoConverter
     27class GenoConv_F41_TestOnly : public GenoConverter
    4528{
    46  public:
    47   GenoConv_F41_TestOnly();
    48   SString convert(SString &in, MultiMap * map);
     29public:
     30        GenoConv_F41_TestOnly();
     31        SString convert(SString &in, MultiMap * map);
    4932};
    5033
    5134
    5235// A Model descendant, which support build from an f4 genotype.
    53 class f4_Model: public Model
     36class f4_Model : public Model
    5437{
    55  public:
    56   f4_Model();
    57   ~f4_Model();
    58   int      buildFromF4(SString &geno);
    59   void     toF1Geno(SString &out);       // output to f1 format, approximation
    60  private:
    61   f4_Cells * cells;
    62   int        buildModelRec(f4_Cell * ndad);
    63   /**
    64   * Get a cell which is a stick, by traversing dadlinks.
    65   */
    66   f4_Cell *  getStick(f4_Cell * C);
    67   int        error;
    68   int        errorpos;
     38public:
     39        f4_Model();
     40        ~f4_Model();
     41        int      buildFromF4(SString &geno);
     42        void     toF1Geno(SString &out);       // output to f1 format, approximation
     43private:
     44        f4_Cells * cells;
     45        int        buildModelRec(f4_Cell * ndad);
     46        /**
     47        * Get a cell which is a stick, by traversing dadlinks.
     48        */
     49        f4_Cell *  getStick(f4_Cell * C);
     50        int        error;
     51        int        errorpos;
    6952};
    7053
    7154
    7255#endif
    73 
Note: See TracChangeset for help on using the changeset viewer.