-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 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,44 @@ | ||
import random | ||
|
||
class ResourceExtractor: | ||
def __init__(self): | ||
self.resources = { | ||
'water': 0, | ||
'oxygen': 0, | ||
'minerals': 0 | ||
} | ||
|
||
def extract_resources(self): | ||
""" | ||
Simulates the extraction of resources from lunar regolith. | ||
:return: Dictionary of extracted resources | ||
""" | ||
self.resources['water'] = self.extract_water() | ||
self.resources['oxygen'] = self.extract_oxygen() | ||
self.resources['minerals'] = self.extract_minerals() | ||
return self.resources | ||
|
||
def extract_water(self): | ||
""" | ||
Simulates water extraction from lunar regolith. | ||
:return: Amount of water extracted in liters | ||
""" | ||
return random.randint(1, 10) # Simulate extraction of 1 to 10 liters | ||
|
||
def extract_oxygen(self): | ||
""" | ||
Simulates oxygen extraction from lunar regolith. | ||
:return: Amount of oxygen extracted in kilograms | ||
""" | ||
return random.uniform(0.5, 2.0) # Simulate extraction of 0.5 to 2 kg | ||
|
||
def extract_minerals(self): | ||
""" | ||
Simulates mineral extraction from lunar regolith. | ||
:return: Amount of minerals extracted in kilograms | ||
""" | ||
return random.randint(5, 20) # Simulate extraction of 5 to 20 kg |