Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

anngenes.cc

Go to the documentation of this file.
00001 
00025 #include <nhp/individual.h>
00026 #include <inanna/annetwork.h>
00027 #include <inanna/topology.h>
00028 #include <inanna/rprop.h>
00029 #include <magic/mclass.h>
00030 
00031 #include "annalee/anngenes.h"
00032 
00033 impl_abstract (ANNGene, {Gentainer});
00034 impl_abstract (ANNEncoding, {Gentainer});
00035 
00037 //                                                                           //
00038 //                   _   |   | |   |  ----                                   //
00039 //                  / \  |\  | |\  | |      ___    _    ___                  //
00040 //                 /   \ | \ | | \ | | --- /   ) |/ \  /   )                 //
00041 //                 |---| |  \| |  \| |   \ |---  |   | |---                  //
00042 //                 |   | |   | |   | |___/  \__  |   |  \__                  //
00043 //                                                                           //
00045 
00046 void ANNGene::addPrivateGenes (Gentainer& parent, const StringMap& params) {
00047     Gentainer::addPrivateGenes (parent, params);
00048 }
00049 
00051 //                                                                          //
00052 //         _   |   | |   | -----                      | o                   //
00053 //        / \  |\  | |\  | |       _    ___           |     _               //
00054 //       /   \ | \ | | \ | |---  |/ \  |   \  __   ---| | |/ \   ___        //
00055 //       |---| |  \| |  \| |     |   | |     /  \ (   | | |   | (   \       //
00056 //       |   | |   | |   | |____ |   |  \__/ \__/  ---| | |   |  ---/       //
00057 //                                                               __/        //
00059 
00060 ANNEncoding::ANNEncoding (const GeneticID& name,
00061                           const StringMap& params)
00062         : Gentainer (name)
00063 {
00064     ASSERT (!isnull(params["inputs"]) && !isnull(params["outputs"]));
00065 
00066     mInputs            = params["inputs"].toInt ();
00067     mMaxHidden         = params["ANNEncoding.maxHidden"].toInt ();
00068     mPrunePassthroughs = params["ANNEncoding.prunePassthroughs"].toInt ();
00069     mOutputs           = params["outputs"].toInt ();
00070 }
00071 
00072 ANNEncoding::ANNEncoding (const ANNEncoding& other) : Gentainer (other) {
00073     mInputs            = other.mInputs;
00074     mMaxHidden         = other.mMaxHidden;
00075     mOutputs           = other.mOutputs;
00076     mPrunePassthroughs = other.mPrunePassthroughs;
00077 }
00078 
00079 void ANNEncoding::copy (const Genstruct& o) {
00080     Gentainer::copy (o);
00081     const ANNEncoding& other = static_cast<const ANNEncoding&>(o);
00082 
00083     mInputs            = other.mInputs;
00084     mMaxHidden         = other.mMaxHidden;
00085     mOutputs           = other.mOutputs;
00086     mPrunePassthroughs = other.mPrunePassthroughs;
00087 }
00088 
00089 void ANNEncoding::check () const {
00090     Gentainer::check ();
00091 
00092     ASSERT (mInputs    >  0);
00093     ASSERT (mInputs    <  1000);   // Sensible upper limit
00094     ASSERT (mMaxHidden >= 0);
00095     ASSERT (mMaxHidden <  100000); // Sensible upper limit
00096     ASSERT (mOutputs   >  0);
00097     ASSERT (mOutputs   <  1000);   // Sensible upper limit
00098 }
00099 
00100 
00101 
00102 

Generated on Thu Feb 10 20:21:26 2005 for Annalee by doxygen1.2.18