Esempio n. 1
0
def run():
    pb_name = "parc_complet"
    pb = parc.build_from_data(pb_name+".json")
    subprocess.call(["rm", "cplex.log"])
    
    print ("Creating Model " + pb_name)
    model = create_unitcommitment_lp(pb, pb_name)
    
    print ("Solving Model")
    solve(model, pb_name)

    print ("Post Treatment")
    results=getResultsModel(pb,model,pb_name)
    

    
    marginal_costs=[0.0 for t in pb.time_steps]
    
    #decomment this part and give the right name of the EOD constraint name
    #to get the marginal cost of the demand at each time step

#    for t in pb.time_steps:
#         results.marginal_costs=dual_variables["balance_"+str(t)]*2.0
         
    printResults(pb, model, pb_name,marginal_costs,results)
def run():
    pb_name = "question1"
    pb = parc.build_from_data(pb_name+".json")

    print ("Creating Model " + pb_name)
    model = create_thermal_plant_lp(pb, pb_name)

    print ("Solving Model")
    solve(model, pb_name)

    print ("Post Treatment")
    results=getResultsModel(pb,model,pb_name)
    printResults(pb, model, pb_name,[],results)