Server-client communication » Historie » Verze 4
Alex Konig, 2021-04-30 20:31
1 | 1 | Alex Konig | h1. Server-client communication |
---|---|---|---|
2 | |||
3 | 2 | Alex Konig | Between server and client are going to be exchanged messages in the form of xml files. |
4 | 1 | Alex Konig | |
5 | 2 | Alex Konig | h2. Request from client to server |
6 | 1 | Alex Konig | |
7 | 2 | Alex Konig | Client can either send: |
8 | 1 | Alex Konig | |
9 | 2 | Alex Konig | * weather data and date |
10 | * start date and end date |
||
11 | 1 | Alex Konig | |
12 | 2 | Alex Konig | First option means that the server will create an approximation of rush level for this specific time and these specific weather conditions and send an answer. |
13 | |||
14 | Second means that the server will need to download weather prediction for those two days, and days in between and create an approximation of rush level for each time period in between. Length of time period depends on how the model was trained. |
||
15 | |||
16 | h3. Weather details |
||
17 | |||
18 | * temperature - double (in °C) |
||
19 | * wind - double (in m/s) |
||
20 | * rain probability - double in range <0, 1> |
||
21 | * weather conditions - an enum |
||
22 | |||
23 | h3. Date details |
||
24 | 3 | Alex Konig | |
25 | 2 | Alex Konig | * day (int) |
26 | * month (int) |
||
27 | * year (int) |
||
28 | * start hour (int) |
||
29 | |||
30 | 4 | Alex Konig | The xml file will always have the format of weather data, date, date. Whether weather should be interpreted from xml and whether second (end) date is included is given by booleans. |
31 | 2 | Alex Konig | |
32 | h2. Response from server to client |
||
33 | |||
34 | Server responds with either one or multiple instances of rush level details. One if the first type of request was sent, multiple if the second type of request was sent. |
||
35 | |||
36 | h3. Response |
||
37 | 3 | Alex Konig | |
38 | 2 | Alex Konig | * hoursPerSegment (int) |
39 | * rush level (one or multiple after each other) |
||
40 | |||
41 | h3. Rush level details |
||
42 | 3 | Alex Konig | |
43 | 2 | Alex Konig | * date (same as specified above) |
44 | * array with integers, sorted by the enum with buildings, values 0-100 (signifying "rushness" in percentage) or value -1 if request couldn't be answered for any reason |
||
45 | |||
46 | |||
47 | If server was unresponsive, client will try again after a while. It will display a warning about problems with server connection. |