示例#1
0
            'weight':
            1.0
        },
        {
            'name': 'carbon',
            'strategy':
            'cumulative_maximize',  # target the max cumulative value
            'weight': 1.0
        },
        {
            'name': 'cost proxy',
            'strategy':
            'cumulative_minimize',  # target the min cumulative value
            'weight': 1.0
        },
    ]

    #----------- STEP 3: Optimize (annealing over objective function) ---------#
    best, optimal_stand_rxs, vars_over_time = schedule(stand_data,
                                                       axis_map,
                                                       valid_mgmts,
                                                       steps=250000,
                                                       report_interval=5000,
                                                       temp_min=0.0006,
                                                       temp_max=2,
                                                       live_plot=True)

    #----------- STEP 4: output results ---------------------------------------#
    print_results(axis_map, vars_over_time)
    write_stand_mgmt_csv(optimal_stand_rxs, axis_map, filename="_results.csv")
示例#2
0
        if best < best_start:
            best_start = best
            best_mgmts = optimal_stand_rxs

    # Now run the full schedule
    best, optimal_stand_rxs, vars_over_time = schedule(
        stand_data,
        axis_map,
        valid_mgmts,
        steps=295000,
        report_interval=5000,
        temp_min=0.00005,
        temp_max=20.0,
        starting_mgmts=best_mgmts,
        live_plot=True)

    #----------- STEP 4: output results ---------------------------------------#,
    print_results(axis_map, vars_over_time)

    with open("results/results.csv", 'a') as fh:
        for i, data in enumerate(vars_over_time.tolist()):
            row = [2013 + i * 5, climate] + data
            fh.write(",".join([str(x) for x in row]))
            fh.write("\n")

    write_stand_mgmt_csv(optimal_stand_rxs,
                         axis_map,
                         filename="results/%s_stands_rx.csv" % climate,
                         climate=climate)
    #import ipdb; ipdb.set_trace()
            temp_max=5.0
        )
        if best < best_start:
            best_start = best
            best_mgmts = optimal_stand_rxs

    # Now run the full schedule
    best, optimal_stand_rxs, vars_over_time = schedule(
        stand_data,
        axis_map,
        valid_mgmts,
        steps=295000,
        report_interval=5000,
        temp_min=0.00005,
        temp_max=20.0,
        starting_mgmts=best_mgmts,
        live_plot=True
    )

    #----------- STEP 4: output results ---------------------------------------#,
    print_results(axis_map, vars_over_time)

    with open("results/results.csv", 'a') as fh:
        for i, data in enumerate(vars_over_time.tolist()):
            row = [2013 + i*5, climate] + data
            fh.write(",".join([str(x) for x in row]))
            fh.write("\n")

    write_stand_mgmt_csv(optimal_stand_rxs, axis_map, filename="results/%s_stands_rx.csv" % climate, climate=climate)
    #import ipdb; ipdb.set_trace()
示例#4
0
            ),
            'weight': 1.0
        },
        {   
            'name': 'carbon',
            'strategy': 'cumulative_maximize', # target the max cumulative value
            'weight': 1.0
        },
        {   
            'name': 'cost proxy',
            'strategy': 'cumulative_minimize', # target the min cumulative value
            'weight': 1.0
        },
    ]

    #----------- STEP 3: Optimize (annealing over objective function) ---------#
    best, optimal_stand_rxs, vars_over_time = schedule(
        stand_data,
        axis_map,
        valid_mgmts,
        steps=250000,
        report_interval=5000,
        temp_min=0.0006,
        temp_max=2,
        live_plot=True
    )

    #----------- STEP 4: output results ---------------------------------------#
    print_results(axis_map, vars_over_time)
    write_stand_mgmt_csv(optimal_stand_rxs, axis_map, filename="_results.csv")