def __init__(self, num_features=10):
		self.features = {}

		n = 0
		for f in habitat_util.generate_features(num_features):
			self.features[n] = f
			n += 1		
def generate_results(n=10, tags=["a", "b"]):

	results = []

	# Get gears.
	gears = fishing_util.generate_gears()

	# Get features.
	features = habitat_util.generate_features(n)

	# Get cells.
	cells = habitat_util.generate_cells(n/2 + 1)

	for i in range(n):
		cell_i = cells[i % len(cells)]
		gear_i = gears[i % len(gears)]
		feature_i = features[i % len(features)]
		o = Result(
				time = i,
				cell = cell_i,
				habitat_type = cell_i.habitats[0].habitat_type,
				gear = gear_i,
				feature = feature_i,
				field = "field_%s" % i,
				tag = tags[i % len(tags)],
				value = i
				)

		results.append(util_registry.get_or_register_object(o,id_func=lambda obj: id(obj)))

	return results
	def test(self):
		s = self.session
		sa_metadata.metadata.drop_all(s.bind)
		sa_metadata.metadata.create_all(s.bind)

		feature = habitat_util.generate_features(1).pop()
		s.merge(feature)
		s.commit()

		self.failUnless(True)