Skip to content

Commit

Permalink
add magic do stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
ZharkovKirill committed Nov 2, 2023
1 parent e21329b commit e741609
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 184 deletions.
28 changes: 0 additions & 28 deletions app/app_new_mcts.py

This file was deleted.

10 changes: 10 additions & 0 deletions app/mcts_run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import mcts_runner

from tendon_graph_evaluators import evaluator_tendon_standart, evaluator_tendon_standart_parallel
from tendon_graph_evaluators import mcts_hyper_default, evaluator_tendon_fast_debug
import tendon_driven_cfg
from rostok.library.rule_sets.rulset_simple_fingers import create_rules

if __name__ == "__main__":
rules_vocab = create_rules()
mcts_runner.run_mcts(rules_vocab, evaluator_tendon_standart_parallel, mcts_hyper_default)
30 changes: 30 additions & 0 deletions app/mcts_runner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from rostok.graph_generators.environments.design_environment import (SubStringDesignEnvironment)
from rostok.graph_generators.mcts_manager import MCTSManager
from rostok.graph_generators.search_algorithms.mcts import MCTS
from rostok.graph_grammar.rule_vocabulary import RuleVocabulary

from rostok.library.rule_sets.rulset_simple_fingers import create_rules
from rostok.graph_grammar.node import GraphGrammar
from rostok.pipeline.generate_grasper_cfgs import MCTSCfg
from rostok.trajectory_optimizer.control_optimizer import GraphRewardCalculator

#from tendon_graph_evaluators import evaluator_tendon_standart, evaluator_tendon_standart_parallel
#from tendon_graph_evaluators import mcts_hyper_default, evaluator_tendon_fast_debug
#import tendon_driven_cfg


def run_mcts(rule_vocabulary: RuleVocabulary, graph_evaluate_object: GraphRewardCalculator,
mcts_hyper: MCTSCfg):
init_graph = GraphGrammar()
env = SubStringDesignEnvironment(rule_vocabulary, graph_evaluate_object,
mcts_hyper.max_number_rules, init_graph, 0)

mcts = MCTS(env, mcts_hyper.C)
name_directory = input("enter directory name: ")
mcts_manager = MCTSManager(mcts, name_directory, verbosity=2, use_date=True)
mcts_manager.save_information_about_search(mcts_hyper,
graph_evaluate_object.simulation_scenario)

for i in range(mcts_hyper.full_loop):
mcts_manager.run_search(mcts_hyper.base_iteration, 1, 1, 2)
mcts_manager.save_results()
84 changes: 0 additions & 84 deletions app/reoptimisation.py

This file was deleted.

72 changes: 0 additions & 72 deletions app/top_graphs_visualisation.py

This file was deleted.

0 comments on commit e741609

Please sign in to comment.