-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #136 from allfed/to_pass_tests3
To pass tests3
- Loading branch information
Showing
17 changed files
with
196 additions
and
546 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
""" | ||
In your command line, be sure to run the following if you update the Dot images: | ||
dot -Tpng overview.dot -o overview.png | ||
dot -Tpng overview_legend.dot -o overview_legend.png | ||
Then to form the complete diagram, run the python script below: | ||
""" | ||
|
||
from PIL import Image | ||
|
||
# Load the images | ||
image1_path = "overview.png" | ||
image2_path = "overview_legend.png" | ||
image1 = Image.open(image1_path) | ||
image2 = Image.open(image2_path) | ||
|
||
# Calculate the size of the combined image | ||
total_width = max(image1.width, image2.width) | ||
total_height = image1.height + image2.height | ||
|
||
# Create a new image with the appropriate size and white background | ||
combined_image = Image.new( | ||
"RGB", (int(total_width * 1.1), total_height - image2.height // 2), color="white" | ||
) | ||
|
||
# Paste the first image at the top | ||
combined_image.paste(image1, (int(total_width * 0.1), 0)) | ||
|
||
# Paste the second image at the bottom | ||
combined_image.paste(image2, (0, image1.height - image2.height // 2)) | ||
|
||
# Save the combined image | ||
combined_image_path = "../overview.png" | ||
combined_image.save(combined_image_path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
digraph ModelOverview{ | ||
// Food Consumption during normal times | ||
norm_consumption [label="Food\nConsumption", fontsize=20, style="filled",fillcolor="#55AA55"]; | ||
Waste[style="filled", fillcolor="#55AA55",fontsize=20] | ||
Waste -> norm_consumption; | ||
Feed[style="filled", fillcolor="#55AA55",fontsize=20] | ||
Feed -> norm_consumption; | ||
Biofuel[style="filled", fillcolor="#55AA55", fontsize=20] | ||
Biofuel -> norm_consumption; | ||
|
||
// Food Ressources during Standard Times | ||
std_resources [label="Standard Food\nResources", style="filled",fontsize=20,fillcolor="#55AA55"]; | ||
stored_food [label="Stored\nFood",style="filled", fontsize=20,fillcolor="#55AA55"]; | ||
outdoor_crop [label="Outdoor\nCrop",style="filled",fontsize=20, fillcolor="#55AA55"]; | ||
meat [label="Meat/Dairy",style="filled", fontsize=20,fillcolor="#55AA55"]; | ||
Fish [style="filled",fontsize=20, fillcolor="#55AA55"] | ||
stored_food -> std_resources; | ||
outdoor_crop -> std_resources; | ||
meat -> std_resources; | ||
Fish -> std_resources; | ||
|
||
// Resilient Foods | ||
res_resources [label="Resilient Food\nResources", style="filled",fontsize=20,fillcolor="#55AA55"]; | ||
Seaweed[style="filled",fontsize=20, fillcolor="#55AA55"] | ||
Seaweed -> res_resources; | ||
Greenhouses[style="filled",fontsize=20, fillcolor="#55AA55"] | ||
Greenhouses -> res_resources; | ||
industrial_food [label="Industrial\nFood",style="filled",fontsize=20, fillcolor="#55AA55"]; | ||
industrial_food -> res_resources; | ||
|
||
// Link foods to the model | ||
model [label="Import\nData", fontsize=25, style="filled", fillcolor="#669999"]; | ||
norm_consumption -> model; | ||
std_resources -> model; | ||
res_resources -> model; | ||
|
||
// Create base scenarios | ||
nw [label="Nuclear\nWinter", fillcolor="#D46A6A",fontsize=20, style="filled"]; | ||
Baseline [label="Baseline", fillcolor="#D49A6A",fontsize=20, style="filled"]; | ||
model -> Baseline; | ||
model -> nw; | ||
|
||
// Create 150 tg scenarios | ||
nw_trade [label="With Trade\nGlobal", fillcolor="#D46A6A", fontsize=20,style="filled"]; | ||
nw_no_trade [label="No Trade\nBy Country", fillcolor="#D46A6A",fontsize=20, style="filled"]; | ||
nw -> nw_trade; | ||
nw -> nw_no_trade; | ||
|
||
nw_trade_no_res_food [label="No Resilient\nFood", fontsize=20, fillcolor="#D46A6A", style="filled"]; | ||
nw_trade_res_food [label="Resilient\nFood", fontsize=20,fillcolor="#D46A6A", style="filled"]; | ||
nw_no_trade_no_res_food [label="No Resilient\nFood",fontsize=20, fillcolor="#D46A6A", style="filled"]; | ||
nw_no_trade_res_food [label="Resilient\nFood", fontsize=20, fillcolor="#D46A6A", style="filled"]; | ||
nw_trade -> nw_trade_no_res_food; | ||
nw_trade -> nw_trade_res_food; | ||
nw_no_trade -> nw_no_trade_no_res_food; | ||
nw_no_trade -> nw_no_trade_res_food; | ||
|
||
|
||
// Create baseline scenarios | ||
Baseline_trade [label="With Trade\nGlobal", fontsize=20, fillcolor="#D49A6A", style="filled"]; | ||
Baseline_no_trade [label="No Trade\nBy Country",fontsize=20, fillcolor="#D49A6A", style="filled"]; | ||
Baseline -> Baseline_trade; | ||
Baseline -> Baseline_no_trade; | ||
|
||
|
||
// Link to optomization and analysis | ||
opt [label="Optimization", style="filled", fontsize=20,fillcolor="#669999"]; | ||
Baseline_trade -> opt; | ||
Baseline_no_trade -> opt; | ||
nw_trade_no_res_food -> opt; | ||
nw_trade_res_food -> opt; | ||
nw_no_trade_no_res_food -> opt; | ||
nw_no_trade_res_food -> opt; | ||
|
||
// Link to analysis | ||
analysis [label="Analysis", style="filled",fontsize=20, fillcolor="#669999"]; | ||
opt -> analysis; | ||
|
||
|
||
|
||
|
||
|
||
|
||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
digraph ModelOverview { | ||
subgraph cluster_0 { | ||
label="Legend"; | ||
// Remove or modify these attributes to control the box appearance | ||
// color=black; // Removed to avoid drawing the box | ||
// penwidth=1; // Removed since we don't want an outline | ||
style=invis; // Makes the subgraph border invisible | ||
fontsize=20; // Increased fontsize for the legend label | ||
fontname="Helvetica bold"; // Specify a bold font for the legend label | ||
|
||
Baseline [label="Baseline Climate\nScenarios", fontsize=20, fillcolor="#D49A6A", style="filled"]; | ||
nw [label="Nuclear Winter\nScenarios", fontsize=20, fillcolor="#D46A6A", style="filled"]; | ||
model [label="Model", fontsize=20, style="filled", fillcolor="#669999"]; | ||
norm_consumption [label="Model\nInputs", fontsize=20, style="filled", fillcolor="#55AA55"]; | ||
|
||
// Define any edges here if necessary | ||
} | ||
// Define any nodes or edges outside the subgraph if you want them outside the box | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.