本文整理汇总了Python中solution.Solution.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Solution.__init__方法的具体用法?Python Solution.__init__怎么用?Python Solution.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类solution.Solution
的用法示例。
在下文中一共展示了Solution.__init__方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from solution import Solution [as 别名]
# 或者: from solution.Solution import __init__ [as 别名]
def __init__(self, p):
Solution.__init__(self, p)
#self.base_solution = GlobalCompensatedUW(p)
voltage = self.voltage
#correct scale factor at 250V, 17 MHz should be about .19
voltage('Q', -9 , 0.010 , -.19, .85)
voltage('Q', -8 , 0.019 , -.19, .85)
voltage('Q', -7 , 0.037 , -.19, .85)
voltage('Q', -6 , 0.089 , -.19, .85)
voltage('Q', -5 , 0.266 , -.19, .85)
voltage('Q', -4 , 0.928 , -.19, .85)
voltage('Q', -3 , 1.587 , -.19, .85)
voltage('Q', -2 , -2.109, -.19, .85)
voltage('Q', -1 , -2.109, -.19, .85)
voltage('Q', 0 , -2.109, -.19, .85)
voltage('Q', 1 , -2.109, -.19, .85)
voltage('Q', 2 , -2.109, -.19, .85)
voltage('Q', 3 , 1.588, -.19, .85)
voltage('Q', 4 , 0.93 , -.19, .85)
voltage('Q', 5 , 0.266 , -.19, .85)
voltage('Q', 6 , 0.090 , -.19, .85)
voltage('Q', 7 , 0.037 , -.19, .85)
voltage('Q', 8 , 0.019 , -.19, .85)
voltage('Q', 9 , 0.010 , -.19, .85)
示例2: __init__
# 需要导入模块: from solution import Solution [as 别名]
# 或者: from solution.Solution import __init__ [as 别名]
def __init__(self, chro_size):
# Constructor.
Solution.__init__(self, num_objs)
# self.min = 0.
# self.max = 1.
self.num_objectives = num_objs
self.size = chro_size
for _ in range(self.size):
self.attributes.append(random.randint(1, 5))
self.evaluate_solution()
示例3: __init__
# 需要导入模块: from solution import Solution [as 别名]
# 或者: from solution.Solution import __init__ [as 别名]
def __init__(self, p):
Solution.__init__(self, p)
#voltage = self._voltage
voltage = self.voltage
voltage('Q', -5, .981, 1.0)
voltage('Q', -4, .981, 1.0)
voltage('Q', -3, .981, 1.0)
voltage('Q', -2, .981, 1.0)
voltage('Q', -1, -.857, .378)
voltage('Q', 0, -1, .378)
voltage('Q', 1, -.857, 1.0)
voltage('Q', 2, .981, 1.0)
voltage('Q', 3, .981, 1.0)
voltage('Q', 4, .981, 1.0)
voltage('Q', 5, .981, 1.0)
示例4: __init__
# 需要导入模块: from solution import Solution [as 别名]
# 或者: from solution.Solution import __init__ [as 别名]
def __init__(self, game_state_as_array):
self.method_name = "Descent Hill Climbing"
self.heuristic_estimate = "H1() (Counting Out Of Placed Tiles)"
Solution.__init__(self, game_state_as_array)
self.setSearchMethod(DescentHillClimbing(H1()))
示例5: __init__
# 需要导入模块: from solution import Solution [as 别名]
# 或者: from solution.Solution import __init__ [as 别名]
def __init__(self, solution, objectives):
Solution.__init__(self, solution, objectives)
self.fitness = float(sys.maxint)
self.evaluation = self.evaluate()
示例6: __init__
# 需要导入模块: from solution import Solution [as 别名]
# 或者: from solution.Solution import __init__ [as 别名]
def __init__(self, game_state_as_array):
self.method_name = "A*"
self.heuristic_estimate = "H1() (Counting Out Of Placed Tiles)"
Solution.__init__(self, game_state_as_array)
self.setSearchMethod(AStar(H1()))
示例7: __init__
# 需要导入模块: from solution import Solution [as 别名]
# 或者: from solution.Solution import __init__ [as 别名]
def __init__(self, game_state_as_array):
self.method_name = "Breadth-First Search"
self.heuristic_estimate = "None"
Solution.__init__(self, game_state_as_array)
self.setSearchMethod(BFS())