Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JORS submission changes #14

Merged
merged 1 commit into from
Aug 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Removing call to interactplot since it has been depreciated. Also add…
…ing lines to save output from optimization and reevaluation.
  • Loading branch information
davidfgold committed Aug 25, 2019
commit a765c1c0aa19f673df3bf488b7f6fb9534df0795
16 changes: 10 additions & 6 deletions examples/Basic/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ def lake_problem(pollution_limit,
# Optimize the model or get cached results if they exist. Note that the
# call to optimize is wrapped in a lambda function to enable lazy evaluation.
output = cache("output", lambda: optimize(model, "NSGAII", 10000))

# save the Pareto approximate set as a .csv file
output.save('optimization_results.csv')


# ----------------------------------------------------------------------------
# Plotting
Expand Down Expand Up @@ -130,11 +134,6 @@ def lake_problem(pollution_limit,
joint(model, output, x="max_P", y="utility")
plt.show()

# Interaction plots show the interaction between two parameters (x and y) with
# respect to a response (z)
interact(model, output, x="max_P", y="utility", z="reliability", filled=True)
plt.show()

# A histogram of the distribution of points along each parameter
hist(model, output)
plt.show()
Expand All @@ -157,9 +156,14 @@ def lake_problem(pollution_limit,
# Or select one of our optimization results
policy = output[3]

# Construct a specific policy and evaluate it against 1000 states-of-the-world
# Construct a spexcific policy and evaluate it against 1000 states-of-the-world
SOWs = sample_lhs(model, 100)
results = evaluate(model, update(SOWs, policy))

# save the results as a .csv file
results.save('reevaluation_results.csv')

# define performance criteria
metric = ["Reliable" if v["reliability"] > 0.9 else "Unreliable" for v in results]

# Use PRIM to identify the key uncertainties if we require reliability > 0.9
Expand Down