From 7291a46b6ab3d868d8bb34b27ed4d8aacd0cb214 Mon Sep 17 00:00:00 2001 From: Dmitry Belan Date: Wed, 1 Jul 2026 13:47:06 +0300 Subject: [PATCH] Add base farm automation code (main branch) --- farm_core/__init__.py | 1 + farm_core/agent.py | 8 ++++++++ farm_core/module.py | 13 +++++++++++++ main.py | 8 ++++++++ 4 files changed, 30 insertions(+) create mode 100644 farm_core/__init__.py create mode 100644 farm_core/agent.py create mode 100644 farm_core/module.py create mode 100644 main.py diff --git a/farm_core/__init__.py b/farm_core/__init__.py new file mode 100644 index 0000000..85e73ff --- /dev/null +++ b/farm_core/__init__.py @@ -0,0 +1 @@ +# Пакет farm_core diff --git a/farm_core/agent.py b/farm_core/agent.py new file mode 100644 index 0000000..fb338da --- /dev/null +++ b/farm_core/agent.py @@ -0,0 +1,8 @@ +class FarmAgent: + def __init__(self, name, module): + self.name = name + self._module = module + + @staticmethod + def get_manual(): + return "Инструкция: pH 6.0" diff --git a/farm_core/module.py b/farm_core/module.py new file mode 100644 index 0000000..f352d64 --- /dev/null +++ b/farm_core/module.py @@ -0,0 +1,13 @@ +class BioCulture: + def __init__(self, id): + self._id = id + self._stage = "Зеленый" + + def grow(self): + # Заглушка, которая вызовет конфликт + raise NotImplementedError("Рост не реализован в main!") + + +class HydroponicModule: + def __init__(self, count): + self.cultures = [BioCulture(i) for i in range(count)] diff --git a/main.py b/main.py new file mode 100644 index 0000000..88804a0 --- /dev/null +++ b/main.py @@ -0,0 +1,8 @@ +from farm_core.module import HydroponicModule +from farm_core.agent import FarmAgent + +if __name__ == "__main__": + print(FarmAgent.get_manual()) + module = HydroponicModule(3) + agent = FarmAgent("AI-Operator", module) + # Студент должен будет написать цикл тут