@@ -207,8 +207,8 @@ struct EvalContext_
207207 Seq * events ;
208208 } profiler ;
209209
210- EvalContextEvalOrder common_eval_order ;
211- EvalContextEvalOrder agent_eval_order ;
210+ EvalOrder common_eval_order ;
211+ EvalOrder agent_eval_order ;
212212};
213213
214214void EvalContextSetConfig (EvalContext * ctx , const GenericAgentConfig * config )
@@ -4062,21 +4062,54 @@ void EvalContextProfilingEnd(EvalContext *ctx, const Policy *policy)
40624062
40634063// ##############################################################
40644064
4065- void EvalContextSetCommonEvalOrder (EvalContext * ctx , EvalContextEvalOrder eval_order )
4065+ void EvalContextSetCommonEvalOrder (EvalContext * ctx , EvalOrder eval_order )
40664066{
40674067 assert (ctx != NULL );
40684068 ctx -> common_eval_order = eval_order ;
40694069}
40704070
4071- void EvalContextSetAgentEvalOrder (EvalContext * ctx , EvalContextEvalOrder eval_order )
4071+ void EvalContextSetAgentEvalOrder (EvalContext * ctx , EvalOrder eval_order )
40724072{
40734073 assert (ctx != NULL );
40744074 ctx -> agent_eval_order = eval_order ;
40754075}
40764076
4077- bool EvalContextIsClassicOrder (EvalContext * ctx )
4077+ const char * EvalContextEvaluationOrderToString (EvalOrder evaluation_order )
4078+ {
4079+ if (evaluation_order == EVAL_ORDER_CLASSIC )
4080+ {
4081+ return "classic" ;
4082+ }
4083+ if (evaluation_order == EVAL_ORDER_TOP_DOWN )
4084+ {
4085+ return "top_down" ;
4086+ }
4087+ return "undefined" ;
4088+ }
4089+
4090+ EvalOrder EvalContextEvaluationOrderFromString (const char * evaluation_order_string )
4091+ {
4092+ if (StringEqual (evaluation_order_string , "classic" ))
4093+ {
4094+ return EVAL_ORDER_CLASSIC ;
4095+ }
4096+ if (StringEqual (evaluation_order_string , "top_down" ))
4097+ {
4098+ return EVAL_ORDER_TOP_DOWN ;
4099+ }
4100+ return EVAL_ORDER_UNDEFINED ;
4101+ }
4102+
4103+ bool EvalContextIsClassicOrder (EvalContext * ctx , const Bundle * bp )
40784104{
40794105 assert (ctx != NULL );
4106+ assert (bp != NULL );
4107+
4108+ if (bp -> evaluation_order != EVAL_ORDER_UNDEFINED )
4109+ {
4110+ // bundle evaluation order overrides common or agent control
4111+ return bp -> evaluation_order == EVAL_ORDER_CLASSIC ;
4112+ }
40804113
40814114 if (ctx -> config -> agent_type != AGENT_TYPE_AGENT )
40824115 {
0 commit comments