- private Tactics parentTactics;- private List<AbstractModule> modules;- private List<ExtAction> modulesExtAction;- private List<CommandExecutor> modulesCommandExecutor;
modules:通过类型可以看出它作用是存储AbstractModule类型的模块。而AbstractModule包括TargetAllocator、TargetDetector、Clustering和PathPlanning及其各子类;位置为
modulesExtAction:它的作用是存储ExtAction类型的行为模块。ExtAction包括ActionExtClear、ActionExtMove、ActionFireFighting和ActionTransport四大行为;位置为adf.ExtAction
modulesCommandExecutor:它的作用是存储CommandExecutor类型的命令解析模块。CommandExcutor包括如下图所示,它位于
结构如图所示
registerModule() :三个重载的方法,分别是把相应类型的模块放到对应的List里
unregisterModule() :同样三个重载的方法,分别把相应类型的模块从List中Remove,返回值为布尔类型。
剩下四个Precompute、Resume、Preparate和UpdateInfo :分别为属性中那三个List作对应的操作(Precompute,Resume等等)
总的来说它们的作用就是把各个模块统一化管理,比如:先把所有模块注册再统一进行更新信息等等。
关于结构中剩下的那几个public型的方法,一般会在子类重写,主要作用也体现在子类中,这里不再赘述。
本文发布于:2024-01-29 09:08:26,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170649051114211.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |