def increase_volume_once(): """ Uses random volume increasing moves to increase the surface area once. """ # Try a random volume increasing move on a random simplex mdata = moves.try_random(moves.list_of_volume_increasing_functions) # If the movedata exists, apply the move if mdata: moves.apply_move(mdata)
def menu(): game_board = np.zeros ((6,6)) # setup initial board game_over = check_victory(game_board) # check if board is not completed print('game_over : ', game_over) apply_move(game_board) while (not game_over): print(' not game over : ', not game_over) game_board = apply_move(game_board) # set game_board to the updated gameboard game_over = check_victory(game_board) # updates board completion print('final game_board :', game_board)
def loop_once(self): """ Runs one iteration of the metropolis loop. """ # Move data for a random move on a random simplex mdata = moves.try_random(moves.list_of_try_functions) # If a move is topologically acceptable, check the fitness # function, and possibly accept it. Otherwise, do nothing. if mdata: do_move = self.confirm_move(mdata) if do_move: moves.apply_move(mdata)