Skip to content

Commit 7707f59

Browse files
committed
Add function and class definitions generated by copilot. Adds README file.
1 parent 2fc1b8c commit 7707f59

File tree

11 files changed

+718
-40
lines changed

11 files changed

+718
-40
lines changed

famodel/installation/01_unload4installation.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
"""
2-
This example unloads a project class from a conceptDesign class.
2+
Script to unload a project class from a ConceptDesign class.
3+
4+
Steps
5+
-----
6+
1. Load the ConceptDesign object.
7+
2. Extract the project class for further processing.
8+
9+
Dependencies
10+
-----------
11+
fadesign.conceptual.conceptDesign.ConceptDesign
312
"""
413
import matplotlib.pyplot as plt
514
import os
@@ -25,6 +34,7 @@
2534
filePath = os.path.dirname(os.path.abspath(__file__))
2635
inputFile = os.path.join(filePath, category, f"{conceptName}.yaml")
2736

37+
# Load the design
2838
concept = ConceptDesign(baseDir=filePath, filename=inputFile, plot=False)
2939
concept.design(plot=False)
3040

famodel/installation/02_load4installation.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44
NOTE: If the project yaml file does not exist, please run 01_unload_driver.py before this
55
so you have a project that you can load here in this example. The project yaml file generated
66
by the unload driver is named proj_{<concept name>}. Insert that in the inputFile in this script.
7+
8+
Steps
9+
-----
10+
1. Load the Project object.
11+
2. Perform analysis using metrics from the fadesign conceptual module.
12+
13+
Dependencies
14+
-----------
15+
famodel.project.Project
16+
fadesign.conceptual.metrics
717
"""
818

919
import matplotlib.pyplot as plt
@@ -24,15 +34,17 @@
2434
windFile = os.path.join(filePath, "sites/wind_data/humboldt_rose_1.csv")
2535
currentFile = os.path.join(filePath, "sites/surface_currents/HumboldtBay_currentRose.csv")
2636

27-
# Load project
37+
# Load project (what was unloaded in 01_unload_driver.py)
2838
proj = Project(file=inputFile)
2939
model = proj.array
3040
model.mooring_currentMod = 0
3141
model.ms.moorMod = 0
3242
proj.trimGrids()
3343

44+
# Plot the project
3445
proj.plot3d(draw_boundary=True, boundary_on_bath=True, draw_bathymetry=True)
3546
plt.show()
47+
3648
# Compute metrics
3749
proj = mtr.metrics(proj, mtricFile, windFile=windFile, currentFile=currentFile)
3850

famodel/installation/03_step1_materialItems.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
"""
2+
Script to create material packages for installation.
3+
4+
Steps
5+
-----
6+
1. Load the Project object.
7+
2. Group components into material packages for transport and installation.
8+
9+
Dependencies
10+
-----------
11+
famodel.project.Project
12+
"""
13+
114
'''Loads an ontology file and performs material itemization.'''
215
import matplotlib.pyplot as plt
316
import os

famodel/installation/04_step2_actionItems.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
"""
2+
Script to generate action items for transport, mobilization, and installation.
3+
4+
Steps
5+
-----
6+
1. Define tasks for each stage of the installation process.
7+
2. Set dependencies between tasks.
8+
9+
Dependencies
10+
-----------
11+
None
12+
"""
13+
114
'''loads material package saved in step1, loads vessel description, and creates action items for transport, mobilization, and installation.'''
215
import matplotlib.pyplot as plt
316
import os
@@ -55,4 +68,4 @@
5568
plt.show()
5669

5770
inst.visualizeAction(install_V1)
58-
plt.show()
71+
plt.show()

famodel/installation/05_install_ex.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
"""
2+
Script to integrate all steps into a complete installation simulation.
3+
4+
Steps
5+
-----
6+
1. Load material packages and action items.
7+
2. Simulate the installation process using the InstallManager.
8+
9+
Dependencies
10+
-----------
11+
None
12+
"""
13+
114
'''an example of how install manager is used to register a vessel and port, and schedule an event and run (not finished yet).'''
215
# from fadesign.conceptual.installation.vessel import Vessel
316
# from fadesign.conceptual.installation.port import Port

famodel/installation/README.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
This IO&M modeling framework was first set up by Rudy Alkarem. README by Ryan Davies
2+
3+
# Description
4+
5+
6+
# Instructions for use
7+
8+
9+
# Misc. Notes
10+
11+
Units of time are hours unless stated otherwise.
12+
13+
Naming convention per Leah: The naming convention used generally for the yamls describes the array so ILIA is individual line individual anchor (SLSA would be shared line shared anchor) and I think 1P2C represents the mooring line type (1 polyester section, 2 chain sections - so likely describing a chain-poly-chain setup) grd is I think for gridded shape (he has some options where there are clusters of turbines instead of grid).
14+
15+
The 01-05 steps were set up with a 3_ILIA_1P2C_grd_mini.yaml, which (I believe) is the same configuration as the Delmar_installation_staging_tool.xlsx, so it that can serve as a verification of this model. if we can't find that input configuration, then we can remake it with the instructions in the `Conceptual Desgin Tutorial.docx` file.
16+
17+
For getting things running, I changed to ______, from `FADesign/scripts/concepts/ILIA/______`.
18+
19+
# Copilot Explaination of the tool
20+
The tool in the `FAModel/famodel/installation` directory is a framework for modeling the installation times and logistics of offshore wind mooring systems. Here's a detailed explanation based on the provided context:
21+
22+
### Purpose
23+
The tool is designed to:
24+
1. **Model Installation Times**: Simulate the time required for various stages of offshore wind mooring system installations, such as material transport, mobilization, and deployment.
25+
2. **Logistics Planning**: Account for logistical constraints like vessel availability, port operations, and environmental conditions.
26+
3. **Step-by-Step Guidance**: Provide numbered example scripts (`01_` to `05_`) that walk users through the process of using the tool.
27+
28+
### Key Components
29+
1. **Example Files (`01_` to `05_`)**:
30+
- These files demonstrate the workflow of the tool:
31+
- 01_unload4installation.py: Unloads a project class from a `ConceptDesign` class.
32+
- 02_load4installation.py: Loads a project class and performs analysis and metrics.
33+
- 03_step1_materialItems.py: Creates material packages for installation.
34+
- 04_step2_actionItems.py: Generates action items for transport, mobilization, and installation.
35+
- 05_install_ex.py: Likely integrates all steps into a complete installation simulation.
36+
37+
2. **Core Classes**:
38+
- `InstallManager`: Manages the overall installation process, including scheduling events, registering vessels and ports, and running simulations.
39+
- `Vessel`: Represents vessels used in the installation process, with methods for mobilization, transit, and state logging.
40+
- `Port`: Represents ports where staging and logistics operations occur.
41+
- `ActionItem` and `Action`: Define tasks and dependencies for installation activities.
42+
43+
3. **Helper Functions**:
44+
- Found in install_helpers.py, these functions handle specific tasks like transporting materials, mobilizing vessels, and visualizing actions.
45+
46+
4. **Configuration Files**:
47+
- YAML files (e.g., VolturnUS-S_example.yaml, `presetLogistics.yaml`) define input parameters for the simulations, such as mooring configurations and logistics setups.
48+
49+
5. **Spreadsheet Tool**:
50+
- `Delmar_installation_staging_tool.xlsm` appears to be a verification or supplementary tool for the model.
51+
52+
### Workflow
53+
The tool's workflow involves:
54+
1. **Loading Project Data**: Using the `ConceptDesign` or `Project` classes to load mooring system configurations.
55+
2. **Creating Material Packages**: Grouping components into packages for transport and installation.
56+
3. **Defining Actions**: Setting up tasks like mobilization, transport, and installation with dependencies.
57+
4. **Simulating Installation**: Running the `InstallManager` to simulate the entire process, considering vessel and port operations.
58+
59+
### Notes from the README
60+
- **Naming Conventions**: YAML file names describe the mooring array type (e.g., `ILIA` for individual line individual anchor, `1P2C` for chain-poly-chain setups).
61+
- **Verification**: The `Delmar_installation_staging_tool.xlsm` can be used to verify the model's outputs.
62+
- **Dependencies**: The tool relies on modules from `fadesign` and famodel.
63+
64+
### Next Steps
65+
1. **Review Example Files**: Start with 01_unload4installation.py and follow the sequence to understand the workflow.
66+
2. **Understand Core Classes**: Examine install_manager.py, vessel.py, and port.py to learn how the tool models logistics.
67+
3. **Run Simulations**: Use the example YAML files and scripts to test the tool.
68+
4. **Extend Functionality**: Based on your requirements, modify or add features to the tool.
69+
70+
Let me know if you need help with specific files or tasks!
71+
72+
73+
# Dependencies to FAD tools
74+
File: `01_unload4installation.py` Dependencies:
75+
```python
76+
from fadesign.conceptual.conceptDesign import ConceptDesign
77+
```
78+
File: `02_load4installation.py` Dependencies:
79+
```python
80+
from famodel.project import Project
81+
from fadesign.conceptual import metrics as mtr
82+
```
83+
File: `03_step1materialItems` Dependencies:
84+
```python
85+
from famodel.project import Project
86+
```
87+
File: `04_step2_actionItems.py` Dependencies:
88+
```
89+
none
90+
```
91+
File: `05_install_ex.py` Dependencies:
92+
```
93+
none
94+
```
95+
File: `action.py` Dependencies:
96+
```
97+
none
98+
```
99+
File: `install_helpers.py` Dependencies:
100+
```
101+
none
102+
```
103+
File: `install_manager.py` Dependencies:
104+
```
105+
none
106+
```
107+
File: `port.py` Dependencies:
108+
```
109+
none
110+
```
111+
File: `vessel.py` Dependencies:
112+
```
113+
none
114+
```

0 commit comments

Comments
 (0)