test(compare): trace deterministic monthly seed progression
This commit is contained in:
@@ -114,7 +114,7 @@ class RaiseDisaster extends \sammo\Event\Action
|
||||
if (!$isGood) {
|
||||
//FIXME: factory 형태로 바꿔야함
|
||||
$generalListByCity = Util::arrayGroupBy($db->query(
|
||||
'SELECT %l FROM general WHERE city IN %li',
|
||||
'SELECT %l FROM general WHERE city IN %li ORDER BY city, no',
|
||||
Util::formatListOfBackticks(General::mergeQueryColumn()[0]),
|
||||
Util::squeezeFromArray($targetCityList, 'city')),
|
||||
'city');
|
||||
@@ -133,6 +133,19 @@ class RaiseDisaster extends \sammo\Event\Action
|
||||
'def' => $db->sqleval('def * %d', $affectRatio),
|
||||
'wall' => $db->sqleval('wall * %d', $affectRatio),
|
||||
], 'city = %i', $city['city']);
|
||||
if (in_array((string)$city['city'], array_filter(explode(',', (string)getenv('REF_AI_TRACE_CITY_IDS')), 'strlen'), true)) {
|
||||
$storedTrust = $db->queryFirstField('SELECT trust FROM city WHERE city = %i', $city['city']);
|
||||
fwrite(STDOUT, 'MONTHLY_FLOAT_TRACE ' . json_encode([
|
||||
'engine' => 'ref',
|
||||
'cityId' => $city['city'],
|
||||
'year' => $year,
|
||||
'month' => $month,
|
||||
'isGood' => false,
|
||||
'inputTrust' => $city['trust'],
|
||||
'affectRatio' => $affectRatio,
|
||||
'storedTrust' => $storedTrust,
|
||||
], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . "\n");
|
||||
}
|
||||
|
||||
$generalList = array_map(
|
||||
function ($rawGeneral) use ($city, $year, $month) {
|
||||
@@ -158,6 +171,19 @@ class RaiseDisaster extends \sammo\Event\Action
|
||||
'def' => $db->sqleval('least(def * %d, def_max)', $affectRatio),
|
||||
'wall' => $db->sqleval('least(wall * %d, wall_max)', $affectRatio),
|
||||
], 'city = %i', $city['city']);
|
||||
if (in_array((string)$city['city'], array_filter(explode(',', (string)getenv('REF_AI_TRACE_CITY_IDS')), 'strlen'), true)) {
|
||||
$storedTrust = $db->queryFirstField('SELECT trust FROM city WHERE city = %i', $city['city']);
|
||||
fwrite(STDOUT, 'MONTHLY_FLOAT_TRACE ' . json_encode([
|
||||
'engine' => 'ref',
|
||||
'cityId' => $city['city'],
|
||||
'year' => $year,
|
||||
'month' => $month,
|
||||
'isGood' => true,
|
||||
'inputTrust' => $city['trust'],
|
||||
'affectRatio' => $affectRatio,
|
||||
'storedTrust' => $storedTrust,
|
||||
], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . "\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user