// model or the simulation run will terminate before
while (imminent == null) {
// get all potentially imminent children
Collection<IBasicDEVSModel> imminentsSel = events.get(cm).dequeueAll();
// select one of these using the responsible select method
imminent = cm.select(new ArrayList<>(imminentsSel));
// if the selected one is a coupled model we need to look in
if (imminent instanceof IBasicCoupledModel) {
cm = (ICoupledModel) imminent;
imminent = null;
}