From 652b3c35b3fd56f72586186b9624c953763878b8 Mon Sep 17 00:00:00 2001 From: KOSASIH Date: Fri, 18 Oct 2024 23:13:44 +0700 Subject: [PATCH] Create resource_extraction.py --- src/isru_module/resource_extraction.py | 44 ++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/isru_module/resource_extraction.py diff --git a/src/isru_module/resource_extraction.py b/src/isru_module/resource_extraction.py new file mode 100644 index 0000000..0da7ad1 --- /dev/null +++ b/src/isru_module/resource_extraction.py @@ -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