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

node.h

00001 /***************************************************************************
00002                           node.h  -  description
00003                              -------------------
00004     begin                : Thu Dec 13 2001
00005     copyright            : (C) 2001 by Rudiger Koch
00006     email                : rkoch@rkoch.org
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef NODE_H
00019 #define NODE_H
00020 
00021 #include <pthread.h>
00022 #include <amygdala/instance.h>
00023 
00024 class MpNetwork;
00025 
00031 class Node {
00032 private:
00036     Node();
00038   static void* NetworkThread(void* mpNetwork);
00039 public:
00040     ~Node();
00041 
00044   void Run(unsigned int maxRunTime);
00045 
00048   MpNetwork* MakeNetwork(int instId);
00049 
00058   void ConnectNeurons(AmIdInt preInstId, AmIdInt preNId, AmIdInt postInstId, AmIdInt postNId, float weight, AmTimeInt delay);
00059 
00061   static Node* GetNodeRef();
00062 
00065   void UdpListener(int port);
00066 
00067 
00068   unsigned int GetMaxRunTime();
00069 
00073   bool NNthreadSleep(unsigned int simTime);
00074 
00076   void NNthreadWakeUp();
00077 
00082   void Save(string filename);
00086   void ConnectLayers(AmIdInt preInstance, AmIdInt preLayer, AmIdInt postInstance, AmIdInt postLayer, GaussConnectType parms, float pctInhibitory=0.0);
00088   void Load(string filename);
00090   void DeleteInstance(AmIdInt instId);
00093   Network* GetNetwork(AmIdInt instId);
00095   hash_map <AmIdInt, Instance*>::iterator instance_begin();
00097   hash_map <AmIdInt, Instance*>::iterator instance_end();
00099   Instance * GetInstance(AmIdInt instId);
00100 
00101 
00102 protected: // Protected attributes
00104   hash_map<AmIdInt, Instance*> instances;
00106   static Node theNode;
00108   unsigned int maxRunTime;
00109 
00114   int sleepers;
00119   int NNthreads;
00120   pthread_mutex_t mut_sleeper;
00121   pthread_cond_t cond_sleeper;
00122 };
00123 
00124 #endif

Generated on Wed Sep 4 02:30:35 2002 for Amygdala by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002