This commit is contained in:
HH 2023-02-03 10:27:55 -08:00
Родитель 8627b66be7
Коммит 48bba94541
8 изменённых файлов: 98 добавлений и 4115 удалений

Просмотреть файл

@ -29,7 +29,9 @@ namespace Unity.MLAgentsExamples
touchingGround = true;
if (penalizeGroundContact)
{
agent.SetReward(groundContactPenalty);
agent.AddReward(groundContactPenalty);
// agent.AddReward(groundContactPenalty/(agent.MaxStep/5));
// agent.SetReward(groundContactPenalty);
}
if (agentDoneOnGroundContact)

Просмотреть файл

@ -417,6 +417,11 @@ PrefabInstance:
propertyPath: m_RayLayerMask.m_Bits
value: 576
objectReference: {fileID: 0}
- target: {fileID: 3599283674160848331, guid: dd62a2a5a838943fba3d2cbb377a75b3,
type: 3}
propertyPath: agentDoneOnGroundContact
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3599283674250582713, guid: dd62a2a5a838943fba3d2cbb377a75b3,
type: 3}
propertyPath: m_Mass
@ -427,6 +432,16 @@ PrefabInstance:
propertyPath: m_Mass
value: 8
objectReference: {fileID: 0}
- target: {fileID: 3599283674258174711, guid: dd62a2a5a838943fba3d2cbb377a75b3,
type: 3}
propertyPath: agentDoneOnGroundContact
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3599283674353725471, guid: dd62a2a5a838943fba3d2cbb377a75b3,
type: 3}
propertyPath: agentDoneOnGroundContact
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3599283674695887336, guid: dd62a2a5a838943fba3d2cbb377a75b3,
type: 3}
propertyPath: m_IsActive
@ -437,6 +452,11 @@ PrefabInstance:
propertyPath: m_RayLayerMask.m_Bits
value: 576
objectReference: {fileID: 0}
- target: {fileID: 3599283674701520976, guid: dd62a2a5a838943fba3d2cbb377a75b3,
type: 3}
propertyPath: agentDoneOnGroundContact
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3599283674701520978, guid: dd62a2a5a838943fba3d2cbb377a75b3,
type: 3}
propertyPath: m_Mass
@ -447,6 +467,21 @@ PrefabInstance:
propertyPath: m_Mass
value: 7
objectReference: {fileID: 0}
- target: {fileID: 3599283674879403207, guid: dd62a2a5a838943fba3d2cbb377a75b3,
type: 3}
propertyPath: agentDoneOnGroundContact
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3599283674929991235, guid: dd62a2a5a838943fba3d2cbb377a75b3,
type: 3}
propertyPath: agentDoneOnGroundContact
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3599283675061353162, guid: dd62a2a5a838943fba3d2cbb377a75b3,
type: 3}
propertyPath: agentDoneOnGroundContact
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3599283675061353172, guid: dd62a2a5a838943fba3d2cbb377a75b3,
type: 3}
propertyPath: m_Mass
@ -462,6 +497,11 @@ PrefabInstance:
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3599283675242808011, guid: dd62a2a5a838943fba3d2cbb377a75b3,
type: 3}
propertyPath: agentDoneOnGroundContact
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3599283675341015702, guid: dd62a2a5a838943fba3d2cbb377a75b3,
type: 3}
propertyPath: m_IsActive
@ -477,6 +517,11 @@ PrefabInstance:
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3599283675594846473, guid: dd62a2a5a838943fba3d2cbb377a75b3,
type: 3}
propertyPath: agentDoneOnGroundContact
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3599283675615088288, guid: dd62a2a5a838943fba3d2cbb377a75b3,
type: 3}
propertyPath: jointDampen
@ -496,7 +541,7 @@ PrefabInstance:
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 5022602860645237092, guid: bc3c6e6725474413795733032966183a,
objectReference: {fileID: 5022602860645237092, guid: 82348ca2df8fb4f1d80ba8962118b34f,
type: 3}
- target: {fileID: 3599283675615088295, guid: dd62a2a5a838943fba3d2cbb377a75b3,
type: 3}
@ -508,16 +553,31 @@ PrefabInstance:
propertyPath: m_Mass
value: 5
objectReference: {fileID: 0}
- target: {fileID: 3599283675835168082, guid: dd62a2a5a838943fba3d2cbb377a75b3,
type: 3}
propertyPath: agentDoneOnGroundContact
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3599283675835168092, guid: dd62a2a5a838943fba3d2cbb377a75b3,
type: 3}
propertyPath: m_Mass
value: 7
objectReference: {fileID: 0}
- target: {fileID: 3599283675894408087, guid: dd62a2a5a838943fba3d2cbb377a75b3,
type: 3}
propertyPath: agentDoneOnGroundContact
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3599283676061639783, guid: dd62a2a5a838943fba3d2cbb377a75b3,
type: 3}
propertyPath: m_Mass
value: 3
objectReference: {fileID: 0}
- target: {fileID: 3599283676062257936, guid: dd62a2a5a838943fba3d2cbb377a75b3,
type: 3}
propertyPath: agentDoneOnGroundContact
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3925309372585159072, guid: dd62a2a5a838943fba3d2cbb377a75b3,
type: 3}
propertyPath: m_RootOrder

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -285,6 +285,14 @@ public class WalkerAgent : Agent
return Mathf.Pow(1 - Mathf.Pow(velDeltaMagnitude / MTargetWalkingSpeed, 2), 2);
}
/// <summary>
/// Penalize for touching ground
/// </summary>
public void TouchedGroundPenalty()
{
AddReward(1f);
}
/// <summary>
/// Agent touched the target
/// </summary>

Просмотреть файл

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: de2807e39b1004d8299e19f4a1ee97ef
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Двоичный файл не отображается.

Просмотреть файл

@ -0,0 +1,16 @@
fileFormatVersion: 2
guid: 96f544effb3d4499eb33b55985e6ab2a
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 683b6cb6d0a474744822c888b46772c9, type: 3}
optimizeModel: 1
forceArbitraryBatchSize: 1
treatErrorsAsWarnings: 0
importMode: 1
weightsTypeMode: 0
activationTypeMode: 0

Просмотреть файл

@ -20,7 +20,7 @@ behaviors:
gamma: 0.995
strength: 1.0
keep_checkpoints: 5
max_steps: 40000000
max_steps: 30000000
time_horizon: 1000
summary_freq: 30000
threaded: true