Beispiel #1
0
def mergeSolutions(thread):
	msg = thread.message
	problemType = msg.ProblemType

	solver = TaskSolver(msg.CommonData)
	value = solver.merge(list(solution.Data for solution in msg.Solutions))
	sumTime = sum(int(solution.ComputationsTime) for solution in msg.Solutions)

	solutions = [{
		"TimeoutOccured": False,
		"Type": "Final", # Partial
		"ComputationsTime": current_time_ms() - thread.started + sumTime,
		"Data": str(value)
	}]
	message = messages.Solutions(msg.Id, msg.ProblemType, solutions, msg.CommonData)
	pending_messages.add(message)
	threads.remove(thread)