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

spikeinput.h

00001 /***************************************************************************
00002                           spikeinput.h  -  description
00003                              -------------------
00004     begin                : Wed Aug 8 2001
00005     copyright            : (C) 2001 by Matt Grover
00006     email                : mgrover@amygdala.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 SPIKEINPUT_H
00019 #define SPIKEINPUT_H
00020 
00021 using namespace std;
00022 #include <amygdala/types.h>
00023 #include <vector>
00024 
00025 
00035 class Network;
00036 
00037 class SpikeInput {
00038 public: 
00039     SpikeInput(Network* network);
00040     virtual ~SpikeInput() = 0;
00041 
00046     bool ReadSpikeList(const char* fileName);
00047     
00051     virtual bool ReadSpikeDef(const char* fileName);
00052     
00060     virtual void ReadInputBuffer() = 0;
00061 
00062     friend class Network;
00063 
00064     void ParseSpikeInput(const char *name, const char **attrs);
00065 
00066 protected:
00067     void SetTime(AmTimeInt now);
00068     void ScheduleQueuedSpikes();
00069     inline void RoundTime(AmTimeInt& time);
00070 
00071     unsigned int currTime;
00072     unsigned int simStepSize;
00073     Network* net;
00074 
00075     struct InSpike {
00076         AmIdInt neuronId;
00077         AmTimeInt spikeTime;
00078         bool operator<(const InSpike& is) const
00079         {
00080             return (spikeTime<is.spikeTime);
00081         }
00082     };
00083 
00084     vector<InSpike> inputSpike;
00085     unsigned int saxErrors;
00086 };
00087 
00088 #endif

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