def _calculate_states(self, solution, t, step, int_step):
next_excitatory = [<NUM_LIT:0.0>] * self._num_osc;<EOL>next_inhibitory = [<NUM_LIT:0.0>] * self._num_osc;<EOL>next_potential = [];<EOL>if (self._params.ENABLE_POTENTIONAL is True):<EOL><INDENT>next_potential = [<NUM_LIT:0.0>] * self._num_osc;<EOL><DEDENT>for index in range (<NUM_LIT:0>, self._num_osc, <NUM_LIT:1>):<EOL><INDENT>if (self._params.ENABLE_POTENTIONAL is True):<EOL><INDENT>result = odeint(self._legion_state, [self._excitatory[index], self._inhibitory[index], self._potential[index]], numpy.arange(t - step, t, int_step), (index , ));<EOL>[ next_excitatory[index], next_inhibitory[index], next_potential[index] ] = result[len(result) - <NUM_LIT:1>][<NUM_LIT:0>:<NUM_LIT:3>];<EOL><DEDENT>else:<EOL><INDENT>result = odeint(self._legion_state_simplify, [self._excitatory[index], self._inhibitory[index] ], numpy.arange(t - step, t, int_step), (index , ));<EOL>[ next_excitatory[index], next_inhibitory[index] ] = result[len(result) - <NUM_LIT:1>][<NUM_LIT:0>:<NUM_LIT:2>];<EOL><DEDENT>neighbors = self.get_neighbors(index);<EOL>coupling = <NUM_LIT:0><EOL>for index_neighbor in neighbors:<EOL><INDENT>coupling += self._dynamic_coupling[index][index_neighbor] * heaviside(self._excitatory[index_neighbor] - self._params.teta_x);<EOL><DEDENT>self._buffer_coupling_term[index] = coupling - self._params.Wz * heaviside(self._global_inhibitor - self._params.teta_xz);<EOL><DEDENT>result = odeint(self._global_inhibitor_state, self._global_inhibitor, numpy.arange(t - step, t, int_step), (None, ));<EOL>self._global_inhibitor = result[len(result) - <NUM_LIT:1>][<NUM_LIT:0>];<EOL>self._noise = [random.random() * self._params.ro for i in range(self._num_osc)];<EOL>self._coupling_term = self._buffer_coupling_term[:];<EOL>self._inhibitory = next_inhibitory[:];<EOL>self._excitatory = next_excitatory[:];<EOL>if (self._params.ENABLE_POTENTIONAL is True):<EOL><INDENT>self._potential = next_potential[:];<EOL><DEDENT>
!
        @brief Calculates new state of each oscillator in the network.

        @param[in] solution (solve_type): Type solver of the differential equation.
        @param[in] t (double): Current time of simulation.
        @param[in] step (double): Step of solution at the end of which states of oscillators should be calculated.
        @param[in] int_step (double): Step differentiation that is used for solving differential equation.