제품 및 서비스 개발 : 대구광역시 공공데이터 활용 창업경진대회 2024

아이디어 | 공공데이터 | 창업 | 정성평가

  • moneyIcon 상금 : 500만원
  • 44명 마감
마감

 

신재생에너지와 하이브리드 도심 스마트팜

공동작성자

stroke
2024.06.07 11:54 891 조회 language

import random

# 상추 성장 시뮬레이션 함수
def lettuce_growth_simulation(days, min_temp, max_temp):
    growth_per_day = 1  # 하루 성장량 (가상의 수치, 1 단위로 가정)
    total_growth = 0
    growth_log = []

    for day in range(1, days + 1):
        temperature = random.uniform(min_temp, max_temp)
        if 15 <= temperature <= 20:  # 온도가 15도에서 20도 사이인 경우
            growth = growth_per_day
        else:
            growth = 0  # 온도가 범위를 벗어나면 성장 없음
        total_growth += growth
        growth_log.append((day, temperature, total_growth))

    return growth_log

# 시뮬레이션 설정
days = 30
min_temp = 15
max_temp = 20

# 시뮬레이션 실행
growth_log = lettuce_growth_simulation(days, min_temp, max_temp)

# 결과 출력
for entry in growth_log:
    day, temperature, total_growth = entry
    print(f"Day {day}: Temperature = {temperature:.2f}°C, Total Growth = {total_growth:.2f} units")

PDF
로그인이 필요합니다
0 / 1000
레오88
2024.06.16 15:13

내용이 좋고, 내용을 적극 공감합니다.

레오7788
2024.06.17 08:03

삭제된 댓글입니다