|
SafeAPI RBC 2oo2 Generic Application
IL/CTC route and train logic for the safeAPIRBC2oo2 reference RBC
|
GA's own single entry point (ab_ga_ma_adaptation_init(), declared in ga_interface.h) - see ab_ga_ma_logic_adaptation.h. More...
#include "ab_ga_ma_logic_adaptation.h"#include "safeapi/oal/log/sapi_log.h"#include "common_config.h"#include "ab_siteGA.h"#include "../main/ab_ga_dispatch.h"#include "../il/ab_ga_il.h"Go to the source code of this file.
Functions | |
| static bool | train_holds_preceding_route (const ab_gp_db_t *db, const ab_site_ga_route_layout_t *layout, uint8_t train_id) |
Checks if the given train already holds a preceding route connecting to layout. | |
| static bool | validate_route_assignment (void *context, uint16_t route_id, uint8_t train_id) |
| sapi_status_t | ab_ga_ma_adaptation_init (ab_gp_train_session_t *sessions, ab_gp_db_t *db, sapi_example_site_t site, const char *role_tag) |
Variables | |
| const char * | g_ga_role_tag = "" |
GA's own single entry point (ab_ga_ma_adaptation_init(), declared in ga_interface.h) - see ab_ga_ma_logic_adaptation.h.
Definition in file ab_ga_ma_logic_adaptation.c.
| sapi_status_t ab_ga_ma_adaptation_init | ( | ab_gp_train_session_t * | sessions, |
| ab_gp_db_t * | db, | ||
| sapi_example_site_t | site, | ||
| const char * | role_tag ) |
Global functions
Definition at line 35 of file ab_ga_ma_logic_adaptation.c.
|
static |
Checks if the given train already holds a preceding route connecting to layout.
Local function declarations
Definition at line 68 of file ab_ga_ma_logic_adaptation.c.
|
static |
GP's own registered route validator (see ab_ga_ma_logic_adaptation_init()) - GP calls this once per candidate route<->train connection, before it connects anything. context is the ab_gp_db_t* passed to ab_ga_ma_logic_adaptation_init(). Purely "is route_id itself a real,
valid site route" - the "not already used_in_ma by a different
train" check already lives inside ga_interface.h's own ab_gp_db_route_connect_train() (called separately, only if this validator approves), so this validator does not need train_id itself; kept in the signature for symmetry with a future GA validator that might. Same behavior this codebase has had since before the GA/GP split - genuinely relocated, not reinterpreted.
Definition at line 114 of file ab_ga_ma_logic_adaptation.c.
| const char* g_ga_role_tag = "" |
Local makros Local types declarations Local variables declarations Global variables declarations
GA-wide role tag, set once at ab_ga_ma_logic_adaptation_init() - see that file's own g_ga_role_tag definition. Used here for logging only, same as every other GA module.
Definition at line 27 of file ab_ga_ma_logic_adaptation.c.