[ml-agents] how to park a car (2)
carController
parameter
- speed
- torque(돌림힘)
- minpeedBeforeTorque
- minSpeedBeforeIdle(idle 애니매이션 변화)
- enum Direction
update
- 애니매이션 상태 변경 -> ApplyAnimatorState
fixedUpdate
ApplyMovement
- keyboard로 조정할 수 있는 car 위치 및 속도 조정, 애니매이션 상태도 조정 가능.
ApplyAnimatorState
- 애니매이션 상태 조절(idle, forworad, backward, left, right)
carApplyTorque()
BaseAgent
- 평소, 성공, 실패 시 바꿀 Material 요소
- SwapGroundMaterial함수 (시도 시 material을 바꿈)
CarAgent
parameter
- Reference
- Vector3 originalPosition;
- BehaviorParmeters behaviorParmeters;
- CarController carController;
- Rigidbody carControllerRigidBody;
- CarSpots carSpots;
Initalize
ResetParkingLotArea
- BehavoiorType에 따라 자동, 수동 조정 가능(위치, rotation, 속도)
- carSpot.Setup() : car의 state를 랜덤으로 설정
CollectObservations
- 정답지에 근처할 때(위치, 속도, rotation) 캡쳐해서 tensorflow가 학습함 for sensor(Ray Perception sensor)
OnActionReceived
- switch case : 어느정도로 움직일 건지
- AddReward(-1f/MaxStep) : 패널티 및 보상 부여
GivePoints
- 장애물에 부딪힐 때 point (정답지 -> 성공 material로 바꿈)
TakeAwayPoint
Heuristic
Car Spot
- car tohide : car spot 개수 설정