Initialize variables.
          j is the time variable (x-axis)
V_stable = ( + )/2.0f   is set as the midpoint between   
           and
= V_stable            is the output of the system
_work =        the current max value for
_work =         the current min min value for
state = “e”           state “e” is for exciter, i for inhibitor
T = tolerence              Set T to the tolerence value, we want to reach   
            _work and _work within tolerance
           value T.
C = increment value          Set C to the value that is   
           increment/decremented by
Generate patterns.
While (running) {
Excite state.
In the excite state, is incremented until it reaches .
if (state is excite) {
 increment by amount C;
If exceeds the current max value for , _work,
  transiton to the inhibit state.
 if ( >= ( _work−T)) {
    Set the state to inhibit.
   state = “i”
    Diminish the current min value for , _work,
    by the weight from Exciter to Inhibitor, .
    _work = _work *
 }
}
Inhibit state.
else if (state == “i”) {
 decrement by amount C;
If is less than the current min value for , _work,
  transiton to the excite state.
  if ( <= ( _work + T)) {
    Set the state to excite.
   state = “e”
    Increase the current max value for , _work,
    by the weight from Inhibitor to Excitor, .
    _work = _work *
  }
 }
Output data.
 print(j, )
Increment count.
}
Algorithm 1