예제 #1
0
def main(argv):
	parser = OptionParser(usage="Usage: python run.py")
	#parser.add_option("-j", "--json",
	#	action="store_true",
	#	dest="json_flag",
	#	default=False,
	#	help="take JSON-formatted feature data")

	#parser.add_option("-c", "--csv",
	#	action="store_true", 
	#	dest="csv_flag",
	#	default=False,
	#	help="take CSV-formatted features data")

	#parser.add_option("-m", "--model",
	#	action="store_true", 
	#	dest="model_flag",
	#	default=False,
	#	help="load previously generated model")

	(options, filenames) = parser.parse_args()

	ga = GeneticAlgorithmStrategy()
	print ga.getSingleLimit()
	def test_getSingleLimit_1(self):
		ga = GeneticAlgorithmStrategy()
		value = ga.getSingleLimit()
		self.assertTrue(value > 0.0 and value < 1.0)
	def test_getMutateAmounts_1(self):
		ga = GeneticAlgorithmStrategy()
		ga.mutateAmounts(0.1)
		self.assertTrue(True)
	def test_getSingleLimit_2(self):
		ga = GeneticAlgorithmStrategy()
		value1 = ga.getSingleLimit()
		ga.mutate(0.1)
		value2 = ga.getSingleLimit()
		self.assertTrue(value1 != value2)