def next_state_after_event(agents, event, prev_state, max_pos, suffix_start):
	"""
	Get the next state in the field event transition system after event
	occurs at prev_state.

	Parameters
	----------
	event: A tuple
		An event is a tuple of the form (agent_no, run_pos). This argument
		can either be a tuple of events (simultaneous events) or a tuple of
		integers (single event).

	prev_state: A tuple
		Previous state of the field event transition system. Elements can be
		integers for events that have just occured or tuples for traveling
		states.

	Returns
	-------
	next_state: A tuple giving the next state of field_ts

	"""

	next_state = [ss for ss in prev_state]
	changed_agents = set()

	# Register new positions of all agents
	for e in event:
		changed_agents.add(e.agent)
		next_state[e.agent] = e.pos

	# Agents can't just wait at some state
	# change states of remaining agents to appropriate traveling states
	for agent in agents:
		if agent not in changed_agents and type(next_state[agent]) != tuple:
			if (next_state[agent]+1) <= max_pos:
				next_state[agent] = (next_state[agent],next_state[agent]+1)
			else:
				# Handle the case we wrap to suffix start
				next_state[agent] = (next_state[agent],suffix_start)

	return tuple(next_state)