Skip to main content

A library for ecological systems modeling and simulations

Project description

EcoSim

EcoSim - это библиотека для проведения симуляций экосистем с учетом множества факторов.

Установка

Установка производится через pip:

pip install ecosim

Для установки последней версии из репозитория:

pip install git+https://github.com/FlacSy/EcoSim

Быстрый старт

Импорт и использование библиотеки

from ecosim import Climate, AnimalPopulation, PlantDistribution, Ecosystem, PredatorPreyPopulation, plot_simulation

def main():
    # Создание объектов, описывающих климат, популяцию животных, распределение растений и взаимодействие хищник-жертва
    climate = Climate(initial_temperature=15.0, temperature_variability=1.0, initial_precipitation=100.0, precipitation_variability=10.0)
    animal_population = AnimalPopulation(initial_population=100, birth_rate=0.1, death_rate=0.05, migration_rate=0.01)
    plant_distribution = PlantDistribution(initial_distribution=1000, spread_rate=50, competition_factor=0.01)
    predator_prey_population = PredatorPreyPopulation(prey_population=500, predator_population=50, prey_birth_rate=0.2, predator_birth_rate=0.1, predation_rate=0.01, predator_death_rate=0.05)

    # Создание экосистемы с учетом заданных параметров
    ecosystem = Ecosystem(climate, animal_population, plant_distribution, predator_prey_population)

    # Подготовка данных для симуляции
    data = {
        'Temperature': [],
        'Precipitation': [],
        'Animal Population': [],
        'Plant Distribution': [],
        'Prey Population': [],
        'Predator Population': []
    }

    # Симуляция на протяжении 50 лет
    for year in range(50):
        ecosystem.simulate_year()
        # Запись данных о состоянии экосистемы
        data['Temperature'].append(climate.temperature)
        data['Precipitation'].append(climate.precipitation)
        data['Animal Population'].append(animal_population.population)
        data['Plant Distribution'].append(plant_distribution.distribution)
        data['Prey Population'].append(predator_prey_population.prey_population)
        data['Predator Population'].append(predator_prey_population.predator_population)
    
    # Визуализация результатов симуляции
    plot_simulation(data, 'Ecosystem Simulation Over 50 Years').show()

if __name__ == '__main__':
    main()

Лицензия

EcoSim распространяется под MIT License. Подробности доступны в файле LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

EcoSim-0.0.1.tar.gz (4.3 kB view details)

Uploaded Source

File details

Details for the file EcoSim-0.0.1.tar.gz.

File metadata

  • Download URL: EcoSim-0.0.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.0

File hashes

Hashes for EcoSim-0.0.1.tar.gz
Algorithm Hash digest
SHA256 44cdb5c048ad965befe867e6d5d79114d8c64c644c047402f2e5e7bd789a3895
MD5 3d6004c8fecd5fd93f94b1e5b750d9c5
BLAKE2b-256 d1322c23058510ba8ef4714487773aedde4cf5e804bc209e9459b4b2ab4d6940

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page