//walking
 void walk(){
     static contimer walker;
     double delta=walker.getDelta();
     static double totalTime=0;
     totalTime+=delta;
     totalTime=fmod(totalTime,legSpeed);
     E1=spike(totalTime,legSpeed,15);
     E2=-spike(totalTime,legSpeed,15);
     G2=spike(totalTime,legSpeed,15);
     G1=-spike(totalTime,legSpeed,15);
 }
示例#2
0
char test_spike_l()
{
    double example[20];
    size_t i=0;
    signed char output[20];
    printf("test_spike_l simple... ");
    arange(example,20);
    for(i=0;i<20;i++)
        output[i] = 1;
    example[0] = 100.0; /* Make a spike at the beginning */
    example[19] = 100.0; /* Make a spike at the end */
    example[10] = 100.0; /* Make a spike in the middle */
    spike(output, example, 20, 3, 5, 0.1);
    if(all(output,20))
        return 0;
    for(i=0;i<20;i++) {
        if(i==0 || i==19 || i==10) {
            if(output[i]!=0)
                return 0;
        }
        else {
            if(output[i]!=1)
                return 0;
        }
    }
    return 1;
}
示例#3
0
/*
 *  towers
 *  ------
 *  Draw a tower
 *     at (x,y,z)
 *     dimensions (dx,dy,dz)
 *     rotated th about the y axis
 */
void tower(double x,double y,double z,
	   double dx,double dy,double dz,
	   double th)
{
  glPushMatrix();
  /*  Transformation  */
  glTranslated(x,y,z);
  glRotated(th,0,1,0);
  glScaled(dx,dy,dz);

  cube(0,1.5,0, 1,3,1, 0);
  cube(0,3.5,0, 2,1,2, 45);
  spike(0,1,-3.5, 0.5,1, 90, 90,0,0);
  spike(0,1,3.5, 0.5,1, 90, -90,0,0);
  spike(-3.5,1,0, 0.5,1, 90, 0,0,-90);
  spike(3.5,1,0, 0.5,1, 90, 0,0,90);

  glPopMatrix();
}
bool Neuron::tick(double clock){
	v = 0;

	if (refractions.empty()){
		excite(clock);
		//inhibit(clock);
		if (v >= vt){
			spike(clock);
			return true;
		}
	}
	return false;
}
示例#5
0
char test_spike_long()
{
    double dat[] = { -1 , 3 , 40 , -1 , 1 , -6 , -6 , 1 , 2 , 4 , 3 , 1 , -1 , 40 , 1 , 1 , 4 , 2 , 2 , 2 , 1 , 2 , 100 };
    signed char expected[] = { 1 , 1 , 1  , 1  , 1 , 1  , 1  , 1 , 1 , 1 , 1 , 1 , 1  , 0  , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 };
    size_t len = sizeof(dat)/sizeof(double);
    size_t i=0;
    signed char output[len];
    printf("test_spike_long... ");

    spike(output, dat, len, 7, 5, 0.1);
    for(i=0;i<len;i++) {
        if(expected[i] != output[i]) {
            message = "Expected does not match received.";
            printf("\n");
            print_array(expected, len);
            print_array(output, len);
            return 0;
        }
    }
    return 1;
}
void ArrayOutputSpikeDriver::WriteSpike(const Spike * NewSpike) throw (EDLUTException){
	OutputSpike spike(NewSpike->GetSource()->GetIndex(),NewSpike->GetTime());

	this->OutputBuffer.push_back(spike);
}