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