This commit is contained in:
2024-04-23 08:34:56 +02:00
parent af1cf75b8d
commit bec6c88a63
3 changed files with 22 additions and 27589 deletions

View File

@@ -1 +1 @@
{"count":1,"self":57.8489728,"total":273.2728647,"children":{"InitializeActuators":{"count":40,"self":0.0015049,"total":0.0015049,"children":null},"InitializeSensors":{"count":40,"self":0.0025047999999999997,"total":0.0025047999999999997,"children":null},"AgentSendState":{"count":39417,"self":3.278764,"total":7.4229638,"children":{"CollectObservations":{"count":315360,"self":1.0711507,"total":1.0711507,"children":null},"WriteActionMask":{"count":315360,"self":0.11854429999999999,"total":0.11854429999999999,"children":null},"RequestDecision":{"count":315360,"self":0.5394548,"total":2.9545049,"children":{"AgentInfo.ToProto":{"count":315360,"self":0.3807658,"total":2.4150500999999998,"children":{"GenerateSensorData":{"count":315360,"self":1.6535278,"total":2.0342843,"children":{"RayPerceptionSensor.Perceive":{"count":630720,"self":0.3807565,"total":0.3807565,"children":null}}}}}}}}},"DecideAction":{"count":39417,"self":201.36573439999998,"total":201.3657307,"children":null},"AgentAct":{"count":39417,"self":6.5899427999999993,"total":6.6301796999999993,"children":{"AgentInfo.ToProto":{"count":3862,"self":0.0095677,"total":0.040236999999999995,"children":{"GenerateSensorData":{"count":3862,"self":0.0241485,"total":0.0306693,"children":{"RayPerceptionSensor.Perceive":{"count":7724,"self":0.0065207999999999993,"total":0.0065207999999999993,"children":null}}}}}}}},"gauges":{"BensonV7.CumulativeReward":{"count":3862,"max":10.1914558,"min":-0.5617464,"runningAverage":-0.0396344438,"value":0.0600896031,"weightedAverage":0.125912115}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1713809080","unity_version":"2022.3.11f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2022.3.11f1\\Editor\\Unity.exe -projectpath C:\\Users\\noahk\\Documents\\Unity projects\\Racesm -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-noahk -hubSessionId 837b02b4-3460-4d4b-98bd-f0a6ffa15664 -accessToken DWB9fkNvzhznkjWNmlbZaGbkZ-bcd_svxKhJE2hkqZI005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"AI training","end_time_seconds":"1713809353"}}
{"count":1,"self":5.6324847999999994,"total":5.6505358,"children":{"InitializeActuators":{"count":1,"self":0.0015026999999999998,"total":0.0015026999999999998,"children":null},"InitializeSensors":{"count":1,"self":0.0010003,"total":0.0010003,"children":null},"AgentSendState":{"count":1,"self":0.0025035,"total":0.013547499999999999,"children":{"CollectObservations":{"count":1,"self":0.0015046,"total":0.0015046,"children":null},"WriteActionMask":{"count":1,"self":0.0010012,"total":0.0010012,"children":null},"RequestDecision":{"count":1,"self":0.0085382,"total":0.0085382,"children":null}}},"DecideAction":{"count":1,"self":0.0020005,"total":0.0020005,"children":{"RayPerceptionSensor.Perceive":{"count":2,"self":0,"total":0,"children":null}}}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1713853996","unity_version":"2022.3.11f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2022.3.11f1\\Editor\\Unity.exe -projectpath C:\\Users\\noahk\\Documents\\Unity projects\\Racesm -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-noahk -hubSessionId 249cbe37-b739-48da-be83-8703208ec644 -accessToken 8HP4BNN_d2rYa9gBqxxeXFjsh8NpNokVC4_Asgt7liQ005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"AI training","end_time_seconds":"1713854002"}}

File diff suppressed because it is too large Load Diff

View File

@@ -66,27 +66,11 @@ public class AgentControllerV7 : Agent
transform.localRotation = startRotation;
rigidBody.velocity = Vector3.zero;
rigidBody.angularVelocity = Vector3.zero;
// reset checkpoints
foreach (GameObject checkpoint in checkpoints)
{
checkpoint.GetComponent<Checkpoint>().isCollected = false;
}
}
public override void CollectObservations(VectorSensor sensor)
{
Transform currentCheckpoint = checkpoints[0].transform;
foreach (GameObject checkpoint in checkpoints)
{
bool isCollected = checkpoint.GetComponent<Checkpoint>().isCollected;
if (!isCollected)
{
currentCheckpoint = checkpoint.transform;
break;
}
}
Transform currentCheckpoint = checkpoints[checkpointsReached].transform;
// distance to next checkpoint
sensor.AddObservation(distanceToCheckpoint(currentCheckpoint));
@@ -215,17 +199,7 @@ public class AgentControllerV7 : Agent
}
// rewards
Transform currentCheckpoint = checkpoints[0].transform;
foreach (GameObject checkpoint in checkpoints)
{
bool isCollected = checkpoint.GetComponent<Checkpoint>().isCollected;
if (!isCollected)
{
currentCheckpoint = checkpoint.transform;
break;
}
}
Transform currentCheckpoint = checkpoints[checkpointsReached].transform;
float checkpintDistance = distanceToCheckpoint(currentCheckpoint);
float reward = (1 - Mathf.InverseLerp(0, distanceBetweenCheckpoints, checkpintDistance)) / 500;
@@ -242,10 +216,6 @@ public class AgentControllerV7 : Agent
AddReward(reward);
if (checkpintDistance < 0.1f)
{
currentCheckpoint.GetComponent<Checkpoint>().isCollected = true;