From 6441ef9490d924dfe81c88e46e945b7e7a752de0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9A?= <1486806484@qq.com> Date: Wed, 14 Jun 2023 23:27:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../levelToSpeed.h | 43 ++++++++++++++++++- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/src/林火预测/风速补正综合指标法/levelToSpeed.h b/src/林火预测/风速补正综合指标法/levelToSpeed.h index 810b0e1..4a3a051 100644 --- a/src/林火预测/风速补正综合指标法/levelToSpeed.h +++ b/src/林火预测/风速补正综合指标法/levelToSpeed.h @@ -4,8 +4,47 @@ using namespace std; double levelToSpeed(int level) { double speed = 0; if (level >= 0 && level <= 12) { - static const double table[] = { 0.0, 0.3, 1.6, 3.4, 5.5, 8.0, 10.8, 13.9, 17.2, 20.8, 24.5, 28.5, 32.6 }; - speed = table[level]; + double speed = 0; + switch (level) { + case 1: + speed = 0.3; + break; + case 2: + speed = 1.6; + break; + case 3: + speed = 3.4; + break; + case 4: + speed = 5.5; + break; + case 5: + speed = 8.0; + break; + case 6: + speed = 10.8; + break; + case 7: + speed = 13.9; + break; + case 8: + speed = 17.2; + break; + case 9: + speed = 20.8; + break; + case 10: + speed = 24.5; + break; + case 11: + speed = 28.5; + break; + case 12: + speed = 32.7; + break; + + } + } else if (level == 13) { speed = 35.8;