Beispiel #1
0
def start_experiment(num_ga_iters=50,
                     num_atr_iters=5,
                     trials_per_task=5,
                     experiment_name='eigenhand_ate_threshold_3_object'):
    interface = eigenhand_db_interface.EGHandDBaseInterface()

    task_prototype = eigenhand_db_objects.Task(task_type_id=4, task_time=60)
    em = experiment_manager.ExperimentManager(num_ga_iters,
                                              num_atr_iters,
                                              task_models.small_model_dict,
                                              task_prototype,
                                              trials_per_task,
                                              ate.weighted_threshold_ATE_hand,
                                              interface,
                                              experiment_name=experiment_name)

    print 'clearing old database'
    try:
        interface.prepare_gen_0()
    except:
        em.kill_existing()
        interface.prepare_gen_0()
    print 'starting experiment'
    em.run_experiment()
    em.restore_to_new_dbase()
    output_results(em)

    return em
Beispiel #2
0
def restore_experiment(num_ga_iters=50,
                       num_atr_iters=5,
                       trials_per_task=5,
                       experiment_name='eigenhand_ate_threshold'):
    interface = eigenhand_db_interface.EGHandDBaseInterface()

    task_prototype = eigenhand_db_objects.Task(task_type_id=4, task_time=60)
    em = experiment_manager.ExperimentManager(num_ga_iters,
                                              num_atr_iters,
                                              task_models.small_model_dict,
                                              task_prototype,
                                              trials_per_task,
                                              ate.weighted_threshold_ATE_hand,
                                              interface,
                                              experiment_name=experiment_name)
    em.restore_to_new_dbase()
Beispiel #3
0
def continue_experiment(num_ga_iters=50,
                        num_atr_iters=5,
                        trials_per_task=5,
                        experiment_name='default'):

    task_prototype = eigenhand_db_objects.Task(task_type_id=4, task_time=60)
    em = experiment_manager.ExperimentManager(num_ga_iters,
                                              num_atr_iters,
                                              task_models.small_model_dict,
                                              task_prototype,
                                              trials_per_task,
                                              ate.weighted_threshold_ATE_hand,
                                              [],
                                              experiment_name=experiment_name)

    #em.kill_existing()
    em.db_interface = eigenhand_db_interface.EGHandDBaseInterface()
    print 'killed existing \n'
    em.restore_all()
    print 'restored grasps \n'
    em.run_experiment()
    print 'ran experiment \n '
    em.restore_all()
# Replace 8 with the number of cores you so desire.
import os
import sys
import pathlib

sys.path.append(str(pathlib.Path(__file__).parent.absolute()) + "/../")
import numpy as np
from matplotlib import pyplot as plt
import initial_conditions as init
import experiment_manager as Exp

# Initial conditions are at t=1st Jan 1979 and we will integrate for 100 years.
orbits = 100

# Create an experiment manager for running experiments and handling data.
manager = Exp.ExperimentManager("apophis_baseline")

# Get initial conditions function
problem = init.GetApophis1979

# Number of outputs over the span of our integration (careful as too many points will eat file storage)
output_samples = 2500

# We want to vary the tolerance of TES from 10^-1 to 10^-6 and run an integration
# at each value of tolerance chosen i.e. "samples" integrations
samples = 21
tols_tes = np.logspace(-2, -6, samples)

for tol in tols_tes:
    # Create a config dictionary for parametrising an "experiment".
    config = {}
Beispiel #5
0
"""
@brief To upload the current version of the server side software, including the graspit binary,
the graspit_dispatcher and the graspit monitor, run python ./update_server_files.py from the command line on tonga.

Before uploading, run mk_linux_mosek, and then ./static_mosek_link_cmd on tonga.
"""
import subprocess
import experiment_manager

em = experiment_manager.ExperimentManager(num_ga_iters=0,
                                          num_atr_iters=0,
                                          task_model_list=[],
                                          task_prototype=[],
                                          trials_per_task=0,
                                          eval_functor=[],
                                          db_interface=[])

em.kill_existing()

target_name = "[email protected]:~/gm/"

file_names = [
    "graspit_dispatcher.py", "graspit_dispatch_monitor.py", "../bin/graspit"
]


def upload_file(file_name):
    args = ["scp", file_name, target_name]
    s = subprocess.Popen(args)
    return s.poll()