Ignore:
Timestamp:
05/29/20 15:20:29 (4 years ago)
Author:
Maciej Komosinski
Message:

Utility functions that provide a set of all neuron classes fulfilling given criteria now also filter neuron classes by the desired Model shape type (BALL_AND_STICK or SOLIDS)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/genooperators.h

    r899 r935  
    11// This file is a part of Framsticks SDK.  http://www.framsticks.com/
    2 // Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
     2// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
    33// See LICENSE.txt for details.
    44
     
    193193        static void linearMix(vector<double> &p1, vector<double> &p2, double proportion); ///<mixes two real-valued vectors; inherited proportion should be within [0,1]; 1.0 does not change values (all inherited), 0.5 causes both vectors to become their average, 0.0 swaps values (none inherited).
    194194        static void linearMix(ParamInterface &p1, int i1, ParamInterface &p2, int i2, double proportion); ///<mixes i1'th and i2'th properties of p1 and p2; inherited proportion should be within [0,1]; 1.0 does not change values (all inherited), 0.5 causes both properties to become their average, 0.0 swaps values (none inherited). For integer properties applies random "dithering" when necessary.
    195         static int getActiveNeuroClassCount(); ///<returns active class count
    196         static NeuroClass* getRandomNeuroClass(); ///<returns random neuroclass or NULL when no active classes.
    197         static NeuroClass* getRandomNeuroClassWithOutput(); ///<returns random neuroclass with output or NULL when no active classes.
    198         static NeuroClass* getRandomNeuroClassWithInput(); ///<returns random neuroclass with input or NULL when no active classes.
    199         static NeuroClass* getRandomNeuroClassWithOutputAndNoInputs(); ///<returns random sensor or NULL when no active classes.
    200         static int getRandomNeuroClassWithOutput(const vector<NeuroClass*>& NClist); ///<returns index of random NeuroClass from the NClist or -1 (no neurons on the list that provide output) \e NClist list of available neuron classes
    201         static int getRandomNeuroClassWithInput(const vector<NeuroClass*>& NClist); ///<returns index of random NeuroClass from the NClist or -1 (no neurons on the list that want input(s)) \e NClist list of available neuron classes
     195        static int getActiveNeuroClassCount(Model::ShapeType for_shape_type); ///<returns active class count
     196        static NeuroClass* getRandomNeuroClass(Model::ShapeType for_shape_type); ///<returns random neuroclass or NULL when no active classes.
     197        static NeuroClass* getRandomNeuroClassWithOutput(Model::ShapeType for_shape_type); ///<returns random neuroclass with output or NULL when no active classes.
     198        static NeuroClass* getRandomNeuroClassWithInput(Model::ShapeType for_shape_type); ///<returns random neuroclass with input or NULL when no active classes.
     199        static NeuroClass* getRandomNeuroClassWithOutputAndNoInputs(Model::ShapeType for_shape_type); ///<returns random sensor or NULL when no active classes.
     200        static int getRandomNeuroClassWithOutput(const vector<NeuroClass*>& NClist); ///<returns index of random NeuroClass from the NClist or -1 when no neurons in the list provide output \e NClist list of available neuron classes
     201        static int getRandomNeuroClassWithInput(const vector<NeuroClass*>& NClist); ///<returns index of random NeuroClass from the NClist or -1 when no neurons in the list want input(s) \e NClist list of available neuron classes
    202202        static int getRandomChar(const char *choices, const char *excluded); ///<returns index of a random character from 'choices' excluding 'excluded', or -1 when everything is excluded or 'choices' is empty.
    203203        static NeuroClass* parseNeuroClass(char *&s); ///<returns longest matching neuroclass or NULL if the string does not begin with a valid neuroclass name. Advances \e s pointer.
     
    208208        static bool areAlike(char*, char*); ///<compares two text strings skipping whitespaces. Returns 1 when equal, 0 when different.
    209209        static char* strchrn0(const char *str, char ch); ///<like strchr, but does not find zero char in \e str.
    210         static bool canStartNeuroClassName(const char firstchar); ///<determines if \e firstchar may start NeuroClass name. If not, it may start NeuroClass' (or Neuro's) property name.
     210        static bool canStartNeuroClassName(const char firstchar); ///<determines if \e firstchar may start NeuroClass name. If not, it might start NeuroClass' (or Neuro's) property name.
    211211        //@}
    212212};
Note: See TracChangeset for help on using the changeset viewer.