Code Monkey home page Code Monkey logo

Comments (1)

Elcomiqu321 avatar Elcomiqu321 commented on July 30, 2024

`import nevergrad as ng
from nevergrad.functions.powersystems.core import PowerSystem

budget = 3500
width = 6
depth = 6
num_dams = 6
year_to_day_ratio = 0.5
back_to_normal = 0.5
num_thermal_plants = 6
constant_to_year_ratio = 4.0

power_system_loss = PowerSystem(
num_dams=num_dams,
depth=depth,
width=width,
year_to_day_ratio=year_to_day_ratio,
back_to_normal=back_to_normal,
num_thermal_plants=num_thermal_plants,
constant_to_year_ratio=constant_to_year_ratio,
)

added line:

param = int(power_system_loss.dimension/power_system_loss.num_dams)

changed 'parametrization=power_system_loss.dimension' in the optimizer parameters:

optimizer = ng.optimizers.SplitOptimizer(
parametrization=param, budget=budget, num_workers=1
)

optimizer.minimize(power_system_loss)
power_system_loss(optimizer.provide_recommendation().value)
power_system_loss.make_plots(
f"ps_{num_dams}dams_{depth}_{width}_ytdr{year_to_day_ratio}_btn{back_to_normal}"
f"_num_thermal_plants{num_thermal_plants}_ctyr{constant_to_year_ratio}_budget{budget}.png"
)`

from nevergrad.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.