
import ec

NUM_EC = 4
EXPLORATION_SPACE = [NUM_EC]*(1+NUM_EC)

class Model:
	state, funs = [], []
	out_i = None

	def __init__(self):
		self.state = [None]*NUM_EC
		for i in range(NUM_EC):
			self.funs.append(ec.EC(i))
		self.out_i = None

	def set_out_id(self, i):
		self.out_i = i
	
	def run(self, i):
		output = self.funs[i].run(self.state[i-1])
		if output != None:
			self.state[i] = output 

	def trsfun(self, input):
		self.state = input[1:len(input)]
		self.run(input[0])
		if self.out_i == None:
			return self.state
		else:
			return self.state[self.out_i]
	

