CSIM: physicalmodel.h Source File

physicalmodel.h

Go to the documentation of this file.
00001 
00005 #ifndef _PHYSICALMODEL_H_
00006 #define _PHYSICALMODEL_H_
00007 
00008 #include <map>
00009 #include <string>
00010 #include "csimerror.h"
00011 #include "csimclass.h"
00012 #include "advanceable.h"
00013 #include "modelinput.h"
00014 #include "analogsynapse.h"
00015 #include "readout.h"
00016 
00017 using namespace std;
00018 
00020 
00021 class PhysicalModel : public Advancable {
00022 
00023  public:
00027   PhysicalModel(int input_channels, int output_channels);
00028 
00029   virtual ~PhysicalModel(void);
00030 
00032   virtual int advance(void);
00033 
00035   virtual int addIncoming(Advancable *Incoming) {
00036     return 0;
00037   }
00038 
00040 
00043   virtual int addInput(Advancable *Incoming, char *inputname);
00044 
00046   virtual int addOutgoing(Advancable *Outgoing) {
00047     return 0;
00048   }
00049 
00051 
00054   virtual int addOutput(Advancable *Outgoing, char *outputname);
00055 
00056 
00061   virtual int transform(double** I, double* O) = 0;
00062 
00064   virtual void reset() {};
00065 
00067   virtual int updateInternal();
00068 
00069   inline uint32 nInChannels(void)  { return nIncoming; }
00070   inline uint32 nOutChannels(void) { return nOutputChannels; }
00071   inline uint32 nOutputs(int i) { return nOutgoing[i]; }
00072   uint32* getInputs(int index);
00073   uint32* getOutputs(int index);
00074 
00076   const char* getInputChannelName(int index);
00077   const char* getOutputChannelName(int index);
00078 
00079  protected:
00080 
00084   int register_input_channel(const char *name);
00085 
00089   int register_output_channel(const char *name);
00090 
00092   Advancable **incoming;
00093 
00095   int nIncoming;
00096 
00098   int nIncomingAlloc;
00099 
00101   AnalogSynapse ***outgoing;
00102 
00104   int *nOutgoing;
00105 
00107   int *nOutgoingAlloc;
00108 
00110   int nOutputChannels;
00111 
00113   map<string, int> input_channel_names;
00114 
00116   map<string, int> output_channel_names;
00117 
00118  private:
00120   double **inputs;
00121   
00123   double *outputs;
00124 
00126   int last_input_index;
00128   int last_output_index;
00129 };
00130 
00131 #endif

 
(C) 2003, Thomas Natschläger last modified 07/10/2006