def __init__(self, g): Algorithm.__init__(self, g) self.REPAIR_PERIOD = 20 * self.MSG_PERIOD self.RETRY_PERIOD = self.REPAIR_PERIOD self.tables = {} #init tables self.repair()
def __init__(self, evaluator, neighbourhood_gen, stop_cond, logger=NullLogger()): Algorithm.__init__(self, evaluator, neighbourhood_gen, stop_cond, logger)
def __init__(self, g): Algorithm.__init__(self, g) self.REPAIR_PERIOD=20*self.MSG_PERIOD self.RETRY_PERIOD=self.REPAIR_PERIOD self.tables={} #init tables self.repair()
def __init__(self, verbose=False, alpha=.98, start=500000, end=.25, iterations=200): Algorithm.__init__(self, verbose) self.solution = [ ] # using a list to follow convention of previous algo's # Related to the temperature schedule # T = T*alpha is applied every "iterations" self.alpha = alpha # Increase to slow cooling self.start_temp = start # Increase to run algorithm longer self.end_temp = end # At about .25, the probability is near 0 self.iterations_per_temp = iterations # increase to slow cooling self.temperature = start self.temp_iterations = 0 self.elapsed_time = 0 self.start_time = datetime.now() # value and temp stored at each iteration then written to file for graphing self.value_data = [] self.temperature_data = [] self.moves_to_better = 0 self.moves_to_worse = 0
def __init__(self, memory_size, selection_method): # Los bloques adyacentes a un bloque vacio siempre estan llenos # Los bloques adyacentes a un bloque lleno pueden estar vacios o llenos Algorithm.__init__(self, memory_size) self.selection_method = selection_method # Seleccion de bloque vacio (Primer ajuste, mejor ajuste o peor ajuste) self.full = {} # Mapeo de bloques llenos: PCB -> Bloque self.empty = [Block(0, memory_size - 1)] # Lista de bloques vacios
def __init__ (self, num_players, horizon=100): Algorithm.__init__(self, num_players) # Y[i,j] is the proportion of games player i beat over player j # N[i,j] is the number of games i and j have played against each other self.Y = np.zeros((num_players, num_players)) self.N = np.zeros((num_players, num_players)) self.T = horizon self.ranking_procedure = Copeland(num_players, self.Y)
def __init__(self, g): ''' Constructor ''' Algorithm.__init__(self, g) self.tables = {} #init tables for node in self.g.nodes(): self.tables[node]={}
def __init__(self, strategy="BFS", tree=True, verbose=False): Algorithm.__init__(self, verbose) #self.log_count = 1 self.visited = [] # visisted/explored list for Graph Search self.solution = [] # list of solutions (only 1 if all_solutions=False) self.tree = tree # True for tree search, False for Graph search if not strategy == "BFS" and not strategy == "DFS": return 'ERROR: strategy must be "DFS" or "BFS" (case sensitive)' else: self.strategy = strategy
def __init__(self): Algorithm.__init__(self) self.digits = '123456789' self.rows = 'ABCDEFGHI' self.cols = self.digits self.squares = self.cross(self.rows, self.cols) self.unitlist = ([self.cross(self.rows, col) for col in self.cols] + [self.cross(row, self.cols) for row in self.rows] + [self.cross(row_square, col_square) for row_square in ('ABC','DEF','GHI') for col_square in ('123','456','789')]) self.units = dict((square, [un for un in self.unitlist if square in un]) for square in self.squares) self.peers = dict((square, set(sum(self.units[square],[]))-set([square])) for square in self.squares)
def __init__(self, num_players, ranking_procedure=Copeland, alpha=0.51, horizon=100): Algorithm.__init__(self, num_players) # W[i,j] is the proportion of games player i beat over player j # U[i,j] is the upper confidence interval self.W = np.zeros((num_players, num_players)) self.U = np.zeros((num_players, num_players)) self.Y = np.zeros((num_players, num_players)) self.N = np.zeros((num_players, num_players)) self.T = horizon # Horizon assert(alpha > 0.5) self.alpha = alpha self.ranking = list(range(num_players)) np.random.shuffle(self.ranking) self.ranking_procedure = ranking_procedure(num_players, self.Y)
def __init__(self, strategy="BFS", tree=True, verbose=False, max_depth=0, duplicate_strategy="advanced_list"): Algorithm.__init__(self, verbose) #self.log_count = 1 self.visited = [] # visisted/explored list for Graph Search self.solution = [] # list of solutions (only 1 if all_solutions=False) self.tree = tree # True for tree search, False for Graph search if not strategy == "BFS" and not strategy == "DFS" and not strategy == "IDDFS": return 'ERROR: strategy must be "DFS" or "BFS" or "IDDFS" (case sensitive)' #ensure duplication checking strategy for graphs is on of the following: if not duplicate_strategy == "advanced_list" and not duplicate_strategy == "simple_list" and not duplicate_strategy == "parent_trace": return 'ERROR: strategy must be "advanced_list" or "simple_list" or "parent_trace" (case sensitive)' self.strategy = strategy print(duplicate_strategy) self.dupstrat = duplicate_strategy if strategy == "IDDFS": self.id_depth = 1 self.max_id_depth = max_depth
def __init__(self, params): Algorithm.__init__(self, params) self.loss_train = []
def __init__(self, g): ''' Constructor ''' Algorithm.__init__(self, g) self.old_g = nx.Graph()
def __init__(self, params): Algorithm.__init__(self, params)
def __init__(self, quantum, priorities_quant, aging_quant): Algorithm.__init__(self, PriorityMap(priorities_quant, aging_quant)) self.quantum = quantum
def __init__ (self, num_players): Algorithm.__init__(self, num_players)
def __init__(self): Algorithm.__init__(self, [])
def __init__(self, nodes): Algorithm.__init__(self, nodes) self.nodes_left = [] self.current_state = [self.nodes[0]] self.expanded_state = [] self.heuristic = Heuristic(nodes)
def __init__(self, nodes): Algorithm.__init__(self, nodes)
def __init__(self): Algorithm.__init__(self) self.rows = 'ABCDEFGHI' self.cols = '123456789' self.squares = self.cross(self.rows, self.cols)
def __init__(self, verbose=False): Algorithm.__init__(self, verbose) self.variables = None self.constraints = None
def __init__(self, verbose=False): Algorithm.__init__(self, verbose)
def __init__(self, initTheta, data, labels, alpha_param, lambda_param=0): Algorithm.__init__(self, initTheta, data, labels, alpha_param, lambda_param)
def __init__(self, g): ''' Constructor ''' Algorithm.__init__(self, g) self.table = {}
def __init__(self,initTheta, data,labels, alpha_param=0.1,regularisation_param = 0): Algorithm.__init__(self,initTheta,data,labels, alpha_param, regularisation_param)