본문 바로가기
임베디드/Intern

ASAM OpenSCENARIO: User Guide | 5. Scenario at runtime

by 코곰_ 2024. 3. 8.
인턴하면서 새로 다루게 된 OpenSCENARIO에 대해 정리해보겠습니다!
해당 튜토리얼 참고하여 작성했습니다.
https://www.asam.net/index.php?eID=dumpFile&t=f&f=4092&token=d3b6a55e911b22179e3c0895fe2caae8f5492467

 

 

 

 

 

 

5. Scenario at runtime

5.1 States

StoryboardElement 인스턴스의 life cycle은 5가지 상태로 나뉩니다.

  1. initState: StoryboardElement 의 creation
  2. completeState: 이 cycle동안 StoryboardElement는 start trigger를 기다립니다. start trigger를 정의하거나 상속하는 요소만 completeState를 정의합니다.
  3. runningState: 진행 중이며 완료되지 않은 상태를 나타냅니다.
  4. completeState: 이 cycle에 도달하면, StoryboardElement는 목표에 도달했거나 중단되었습니다.
  5. endState: StoryboardElement 의 cleanup

 

 

 

 

 

 

5.2 Transitions

한 상태에서 다른 상태로의 변경을 Transition이라고 합니다. StoryboardElement life cycle에는 6개의 transition이 있습니다.

  1. startElementLifecycle: StoryboardElement 의 creation
  2. startTransition: runningState 로의 전환. completeState(start trigger를 기다릴 때) 또는 runningState(StoryboardElement가 runningState로 진입할 때)로부터
  3. endTransition: runningState가 끝날 때. runningState가 멈추지 않고 일반적으로 끝났음을 의미한다.
  4. stopTransition: runningState 또는 completeState 에서의 전환. 이는 오버라이딩이나 stop trigger에 의해 StoryboardElement가 멈추었음을 의미한다.
  5. skipTransition: Event에만 적용되고, priority skip에 의해 이벤트를 시작할 수 없는 경우이다.
  6. stopElementLifecycle: StoryboardElement 의 cleanup

 

 

 

 

 

 

5.3 Execution

스토리보드 요소는 해당 요소가 completeState또는 runningState에 있을 때 실행되는 것으로 정의됩니다.

  1. completeState: 하위 요소가 start trigger를 정의하는 경우
  2. runningState: 다른 모든 경우

 

5.3.1 Duration of an execution

Duration time은 다음 세 가지 요소에 의해 결정됩니다.

  1. start trigger를 기다리는 시간
  2. 중첩된 action요소를 실행하는 시간
  3. 모든 Story인스턴스가 완료되었을 때 Storyboard stop trigger를 기다리는 시간

 

5.3.3 Execution patterns

OpenSCENARIO는 다음 Storyboard을 실행하는 동안 여러 실행 패턴을 적용합니다.

  • Parallel execution: 중첩된 StoryboardElement 인스턴스는 항상 병렬로 실행된다. 예를 들어, 하나의 Story안에 여러 Act 인스턴스가 존재한다.
  • Loop execution: Event 인스턴스와 ManeuverGroup 인스턴스는 루프 안에서 실행된다. maximumExecutionCount는 실행 횟수를 나타낸다.
  • Priority based execution:  Event 인스턴스는 정의된 우선순위 안에서 실행된다.
  • Bulk action execution: 정의된 동작을 정의된 actor에 동시에 적용하여 Storyboard 내의 Action인스턴스가 실행됩니다.

 

 

 

 

 

 

 

 

5.4 Storyboard element execution

5.4.1 Execution of an action

 

 

5.4.2 Execution of an event

  • Execution count
    1. 실행 횟수 = maximumExecutionCount: completeState 로 전환
    2. 실행 횟수 < maximumExecutionCount: completeState 로 전환
    3. 실행 횟수 = maximumExecutionCount & completeState이면 skipTransition 으로 전환
  • Event priority
    • Override: priority override되어 트리거된 Event 는 동일한 범위(Maneuver)에서 실행 중인 모든 실행이 종료됩니다. 종료된 Event는 남은 실행 횟수와 무관하게 completeState에서 stopTransition로 전환된다.
    • Skip:  priority skip으로 트리거된 Event는 실행 횟수가 정의되지 않거나 실행이 남아 있는 경우, 이동 하지 않고 runningState로 전환하는 대신 completeState로 전환됩니다. 실행이 남아있다면 Event 실행 횟수가 하나 늘어납니다.
    • Parallel: priority parallel로 트리거된 Event는 동일한 범위(Maneuver)에 있는 다른 Event 인스턴스의 상태와 무관하게 runningState로 이동합니다.

 

5.4.3 Execution of a maneuver

 

5.4.4 Execution of a ManeuverGroup

 

5.4.5 Execution of an act

 

5.4.6 Execution of a story

 

5.4.7 Execution of a storyboard

 

 

 

 

 

 

5.5 Init section execution

시나리오의 init 섹션에서는 시뮬레이션에 초기화를 제공하는 entity 상태 또는 전역 상태를 설정하는 작업을 정의합니다. 이러한 작업은 StoryboardElement인스턴스 실행 전 init 단계에서 처리됩니다.