public void update() {
        if (fired) {
            v = c;
            u = u + d;
            fired = false;
        } else {
            //Simulate 1 ms frame step (can be repeated for larger frame step size)
            v += 0.5f*((0.04f * v + 5.0f) * v + 140.0f - u + getI());
            u += 0.5f*a * (b * v - u);
            v += 0.5f*((0.04f * v + 5.0f) * v + 140.0f - u + getI());
            u += 0.5f*a * (b * v - u);

            if(v >= fThresh){
                v = fThresh;
                fired = true;
            }
        }
        if (Float.isNaN(v) || Float.isNaN(u)) {
            v = c;
            u = b * v;
            fired = false;
        }
        updateHistory(getFired(), selfHistory);
        updateInputHistory();
        updateSTDP();
    }