|
Algorithm 4 Generate Tasks |
Input:
M: Number of existing tasks to be generated.
Q: Number of new tasks to be generated.
: Width of the simulation map.
: Task distribution across the map, which can be random, concentrated, or predetermined.
Output:
T: Set of defined tasks, including their coordinates, arrival time, reward, and duration.
|
-
1:
for to M do
-
2:
Generate initial coordinates for based on and .
.
-
3:
Generate arrival time, end time, duration, and reward for :
Random arrival time and end time.
Random duration.
Random reward.
-
4:
end for
-
5:
for to Q do
-
6:
Generate initial coordinates for based on and .
.
-
7:
Generate arrival time, end time, duration, and reward for :
Random arrival time and end time.
Random duration.
Random reward.
-
8:
end for
-
9:
Set as global data.
|