Ignore:
Timestamp:
01/19/18 19:37:43 (5 years ago)
Author:
Maciej Komosinski
Message:
  • Changed Model::singleStepBuild() to Model::addFromString() to create model elements; the latter requires explicit indication of element type (P/J/N/C)
  • Removed old compatibility source (#ifdef MODEL_V1_COMPATIBLE) from f1->f0 converter and neuron definitions
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/model/modelparts.h

    r714 r726  
    1919
    2020#include <stdio.h>
    21 
    22 //#define MODEL_V1_COMPATIBLE
    2321
    2422class Model;
     
    289287class Neuro;
    290288
    291 #ifdef MODEL_V1_COMPATIBLE
    292 class NeuroItem;
    293 
    294 /** for compatibility with old Neuro/NeuroItem  */
    295 class OldItems
    296 {
    297         Neuro &neuro;
    298         SList syntitems; ///< to be deleted
    299         SList items;
    300         int listok;
    301 public:
    302         OldItems(Neuro &n):neuro(n),listok(0) {}
    303         ~OldItems() {freelist();}
    304         void buildlist();
    305         void freelist();
    306 
    307         int getItemCount();
    308         NeuroItem *getNeuroItem(int i);
    309         NeuroItem *addNewNeuroItem();
    310         int findNeuroItem(NeuroItem *n);
    311 };
    312 #endif
    313 
    314289/** Single processing unit in Framsticks NN.  */
    315290class Neuro : public PartBase
     
    482457        static int getClassIndex(const NeuroClass*nc);
    483458
    484 #ifdef MODEL_V1_COMPATIBLE
    485         friend class OldItems;
    486         paInt neuro_refno; ///< parent ref# (called neuro_refno for compatibility with old Neuro class), @see moredata
    487         paInt conn_refno; ///< the other neuron ref# in N-N connections, can be used by some other items
    488         double weight; ///< weight of the N-N connection and (all?) receptors
    489         double inertia,force,sigmo; //!!!
    490 
    491         /** @deprecated provided only for compatibility with old Neuro/NeuroItem classes.
    492                 use getInputCount() instead. @sa getInputCount() */
    493         int getItemCount() {return oldItems().getItemCount();}
    494 
    495         /** @deprecated provided only for compatibility with old Neuro/NeuroItem classes.
    496                 use getInput() instead. @sa getInput() */
    497         NeuroItem* getNeuroItem(int i) {return oldItems().getNeuroItem(i);}
    498 #endif
    499 
    500 protected:
    501 #ifdef MODEL_V1_COMPATIBLE
    502         /** old Neuro compatibility */
    503         OldItems* olditems;
    504         OldItems& oldItems() {if (!olditems) olditems=new OldItems(*this); return *olditems;}
    505         void invalidateOldItems() {if (olditems) olditems->freelist();}
    506 #endif
    507 
    508 public:
    509 
    510459        // not really private, but you should not access those directly
    511460        double state;
     
    522471};
    523472
    524 #ifdef MODEL_V1_COMPATIBLE
    525 class NeuroItem;
    526 
    527 /// for compatibility with old NeuroItem class.
    528 class NeuroItem: public Neuro
    529 {
    530 public:
    531         NeuroItem() {}
    532 };
    533 #endif
    534 
    535473class NeuroExt : public Neuro
    536474{
Note: See TracChangeset for help on using the changeset viewer.