当前位置: 首页>>代码示例>>Python>>正文


Python Solution.__init__方法代码示例

本文整理汇总了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)
开发者ID:wenlintan,项目名称:trap-control,代码行数:29,代码来源:hoa2.py

示例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()
开发者ID:Shenfang1993,项目名称:SEIMS,代码行数:13,代码来源:nsga2_example.py

示例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)
开发者ID:wenlintan,项目名称:trap-control,代码行数:18,代码来源:hoa.py

示例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()))
开发者ID:Jason-Yuan,项目名称:8PuzzleGameSovler,代码行数:7,代码来源:HillClimbingSolution.py

示例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()
开发者ID:jorgeramirez,项目名称:AE,代码行数:6,代码来源:ga.py

示例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()))
开发者ID:Jason-Yuan,项目名称:8PuzzleGameSovler,代码行数:7,代码来源:AStarSolution.py

示例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())
开发者ID:Jason-Yuan,项目名称:8PuzzleGameSovler,代码行数:7,代码来源:BFSSolution.py


注:本文中的solution.Solution.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。