next method

num next()

Returns the energy at a randomly selected point in the search space.

Note: The new position can be accessed via the getter this.position. The return value of next() can also be accessed via this.value.

Implementation

num next() {
  _position = space.next();
  _value = energy(_position);
  if (_value < _minValue) {
    _minValue = _value;
    _minPosition = _position;
  }
  return _value;
}