stimulussequence.hpp 846 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef __STIMULUSSEQUENCE_HPP__
  2. #define __STIMULUSSEQUENCE_HPP__
  3. #include <vector>
  4. #include <string>
  5. #include <gsl/gsl_rng.h>
  6. typedef struct _SequenceFileHeader {
  7. char finfo[12]; // "sequence"
  8. char version[4]; // "001"
  9. int Length;
  10. int MinStim;
  11. int MaxStim;
  12. } SequenceFileHeader;
  13. class StimulusSequence
  14. {
  15. protected:
  16. std::string SequenceFileName; //directory and filename
  17. SequenceFileHeader SHeader;
  18. std::vector<int> CurStimSequence;
  19. int SeqPointer;
  20. int Length;
  21. public:
  22. StimulusSequence();
  23. StimulusSequence(const char* _SequenceFileName);
  24. ~StimulusSequence();
  25. bool Load(const char* _SequenceFileName);
  26. void GenerateRandomSequence(int, int, const gsl_rng* gslr);
  27. int GetNextSeqElement();
  28. int GetNextRandomElement(const gsl_rng* gslr);
  29. };
  30. #endif // __STIMULUSSEQUENCE_HPP__