Skip to content

Commit

Permalink
Handle if there are more states to be initialized then length of vari…
Browse files Browse the repository at this point in the history
…able
  • Loading branch information
KristofferSkare committed Mar 12, 2024
1 parent 30deb57 commit e521093
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mlfmu/types/fmu_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,8 @@ def get_template_mapping(
input_mapping.append((input_index, inp.variable_references[variable_index]))

for variable_index, state_init_index in enumerate(inp.agent_state_init_indexes):
if variable_index >= len(inp.variable_references):
break
state_init_mapping.append((state_init_index, inp.variable_references[variable_index]))

for out in self.outputs:
Expand Down

0 comments on commit e521093

Please sign in to comment.