示例#1
0
def process(s):
    librarian = Librarian()
    librarian.find_libraries('../..')
    library = librarian.load_library('droneD_complete_templates')
    library.use_cache_dir('_cached/drone_unc1')

    ndp = library.parse_ndp(s)

    combinations = {
        "endurance": (np.linspace(1, 1.5, 10), "hour"),
        "extra_payload": (100, "g"),
        "num_missions": (1000, "[]"),
        "velocity": (1.0, "m/s"),
        'extra_power': (0.5, 'W'),
    }

    result_like = dict(total_cost="USD", total_mass='kg')

    dataU = solve_combinations(ndp,
                               combinations,
                               result_like,
                               upper=1,
                               lower=None)
    dataL = solve_combinations(ndp,
                               combinations,
                               result_like,
                               upper=None,
                               lower=1)

    return dict(dataL=dataL, dataU=dataU)
示例#2
0
def go_drone1_cost():
    librarian = get_test_librarian()
    lib = librarian.load_library('mcdp_theory') 
    ndp = lib.load_ndp('drone1_min_cost')
    
    combinations = get_combinations_drone()
    
    result_like = dict(total_cost='USD')

    data = solve_combinations(ndp, combinations, result_like)
    return data
示例#3
0
def go_drone1_cost():
    librarian = get_test_librarian()
    lib = librarian.load_library('mcdp_theory')
    ndp = lib.load_ndp('drone1_min_cost')

    combinations = get_combinations_drone()

    result_like = dict(total_cost='USD')

    data = solve_combinations(ndp, combinations, result_like)
    return data
示例#4
0
def go_batteries_min_tco():
    librarian = get_test_librarian()
    
    lib = librarian.load_library('mcdp_theory') 
    
    ndp = lib.load_ndp('batteries6_min_tco')
    
    combinations = get_combinations()
    
    result_like = dict(tco="USD")

    data = solve_combinations(ndp, combinations, result_like)
    return data
示例#5
0
def go_batteries_min_joint():
    librarian = get_test_librarian()
    
    lib = librarian.load_library('mcdp_theory') 
    
    ndp = lib.load_ndp('batteries4_min_joint')
    
    combinations = get_combinations()
    
    result_like = dict(cost="USD", maintenance="dimensionless", mass='g')

    data = solve_combinations(ndp, combinations, result_like)
    return data
示例#6
0
def go_batteries_min_cost_mass():
    librarian = get_test_librarian()
    
    lib = librarian.load_library('mcdp_theory') 
    
    ndp = lib.load_ndp('batteries5_min_cost_mass')
    
    combinations = get_combinations()
    
    result_like = dict(cost="USD", mass='g')

    data = solve_combinations(ndp, combinations, result_like)
    return data
示例#7
0
def go_batteries_min_maintenance():
    librarian = get_test_librarian()
    
    lib = librarian.load_library('mcdp_theory') 
    
    ndp = lib.load_ndp('batteries1_min_maintenance')
    
    combinations = get_combinations()
    
    result_like = dict(maintenance="dimensionless")

    data = solve_combinations(ndp, combinations, result_like)
    return data
示例#8
0
def go_batteries_min_tco():
    librarian = get_test_librarian()

    lib = librarian.load_library('mcdp_theory')

    ndp = lib.load_ndp('batteries6_min_tco')

    combinations = get_combinations()

    result_like = dict(tco="USD")

    data = solve_combinations(ndp, combinations, result_like)
    return data
示例#9
0
def go_batteries_min_joint():
    librarian = get_test_librarian()

    lib = librarian.load_library('mcdp_theory')

    ndp = lib.load_ndp('batteries4_min_joint')

    combinations = get_combinations()

    result_like = dict(cost="USD", maintenance="dimensionless", mass='g')

    data = solve_combinations(ndp, combinations, result_like)
    return data
示例#10
0
def go_batteries_min_cost_mass():
    librarian = get_test_librarian()

    lib = librarian.load_library('mcdp_theory')

    ndp = lib.load_ndp('batteries5_min_cost_mass')

    combinations = get_combinations()

    result_like = dict(cost="USD", mass='g')

    data = solve_combinations(ndp, combinations, result_like)
    return data
示例#11
0
def go_batteries_min_maintenance():
    librarian = get_test_librarian()

    lib = librarian.load_library('mcdp_theory')

    ndp = lib.load_ndp('batteries1_min_maintenance')

    combinations = get_combinations()

    result_like = dict(maintenance="dimensionless")

    data = solve_combinations(ndp, combinations, result_like)
    return data
示例#12
0
def process(s):
    librarian = Librarian()
    librarian.find_libraries('../..')
    library = librarian.load_library('droneD_complete_templates')
    library.use_cache_dir('_cached/drone_unc1')

    ndp = library.parse_ndp(s)

    combinations = {
        "endurance": (np.linspace(1, 1.5, 10), "hour"),
        "extra_payload": (100, "g"),
        "num_missions": ( 1000, "[]"),
        "velocity": (1.0, "m/s"),
        'extra_power': (0.5, 'W'),
    }

    result_like = dict(total_cost="USD", total_mass='kg')

    dataU = solve_combinations(ndp, combinations, result_like, upper=1, lower=None)
    dataL = solve_combinations(ndp, combinations, result_like, upper=None, lower=1)

    return dict(dataL=dataL, dataU=dataU)
示例#13
0
def go(model_name):
    lib = get_library()
    nt = 15 * 4
    nr = 15 * 3
    combinations = {
        "min_throughput": (np.linspace(10, 1000, nt), "Hz"),
        "resolution": (np.linspace(1.3, 10, nr), "pixels/deg"),
        "inverse_of_max_latency": (0.0, '1/s')
    }
    result_like = dict(power="W", budget="USD")
    ndp = lib.load_ndp(model_name)

    data = solve_combinations(ndp, combinations, result_like)
    return data
示例#14
0
def go(lib):
    combinations = {
        "capacity": (np.linspace(50, 3000, 10), "Wh"),
        "missions": ( 1000, "[]"),
    }
    result_like = dict(maintenance="dimensionless", cost="USD", mass='kg')
    what_to_plot_res = result_like
    what_to_plot_fun = dict(capacity="Wh", missions="[]")

    ndp = lib.load_ndp('batteries')

    data = solve_combinations(ndp, combinations, result_like)

    r = Report()

    plot_all_directions(r, queries=data['queries'], results=data['results'],
                        what_to_plot_res=what_to_plot_res,
                        what_to_plot_fun=what_to_plot_fun)
    r.to_html('out/batteries-c1.html')
示例#15
0
def go2(lib):
    model_name = 'batteries_squash'
    combinations = {
        "capacity": (np.linspace(50, 3000, 10), "Wh"),
        "missions": (1000, "[]"),
    }
    result_like = dict(cost="USD", mass='kg')
    what_to_plot_res = result_like
    what_to_plot_fun = dict(capacity="Wh", missions="[]")

    ndp = lib.load_ndp(model_name)

    data = solve_combinations(ndp, combinations, result_like)

    r = Report()

    plot_all_directions(r, queries=data['queries'], results=data['results'],
                        what_to_plot_res=what_to_plot_res,
                        what_to_plot_fun=what_to_plot_fun)
    r.to_html('out/batteries_squash-c2.html')