fix POI collision
This commit is contained in:
parent
4690eb2082
commit
584628967d
@ -163,8 +163,8 @@ inline int solve(Maze q) {
|
||||
}; // namespace Solve
|
||||
|
||||
const float initial_temperature = 10;
|
||||
const float initial_temperature_pv = 70;
|
||||
const float termperature_delta = .98;
|
||||
const float initial_temperature_pv = 60;
|
||||
const float termperature_delta = .97;
|
||||
const int population_limit = 30;
|
||||
|
||||
struct Gene {
|
||||
@ -186,11 +186,14 @@ inline void expandAll(Maze q, std::vector<Gene> &res, float t = initial_temperat
|
||||
for (int j : {0, 1}) {
|
||||
for (int d : {-1, 1}) {
|
||||
compiler_assume(q.poi[i][j] >= 0 && q.poi[i][j] < N);
|
||||
int z = q.poi[i][j] + d;
|
||||
if (0 <= z && z < N) {
|
||||
q.poi[i][j] += d;
|
||||
if (0 <= q.poi[i][j] && q.poi[i][j] < N) {
|
||||
bool flag = false;
|
||||
for (int k = 0; k < POI_EXCEED; ++k)
|
||||
flag |= (q.poi[i][0] == q.poi[k][0] && q.poi[i][1] == q.poi[k][1]);
|
||||
|
||||
if (!flag)
|
||||
expand(q, res, t);
|
||||
q.poi[i][j] -= d;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user