Skip to content

Commit

Permalink
Create resource_extraction.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Oct 18, 2024
1 parent 1ba5829 commit 652b3c3
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/isru_module/resource_extraction.py
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

0 comments on commit 652b3c3

Please sign in to comment.