Fixed merge errors

This commit is contained in:
Andrey Gumirov
2022-05-05 15:37:51 +07:00
parent 1cf5776a1b
commit cfb7b71a8a
4 changed files with 0 additions and 89 deletions

View File

@ -70,14 +70,7 @@ public class NPC : Agent, ICharacter
public override void CollectObservations(VectorSensor sensor)
{
<<<<<<< HEAD
var candidates = moveController.GetPointsCandidate();
=======
sensor.AddObservation(Condition.HealthPoints);
sensor.AddObservation(Condition.ArmourPoints);
sensor.AddObservation(Condition.Ammunition);
sensor.AddObservation((int) NPC_State.State);
>>>>>>> 351fa8ee12c499a0374be71a192a5f288611f467
//common sensors
sensor.AddObservation(GameManager.IsHaveSeenByEnemy(AgentCharacter.Team.GetOppositeTeam(),
@ -100,7 +93,6 @@ public class NPC : Agent, ICharacter
//point sensors
foreach (var point in candidates)
{
<<<<<<< HEAD
bufferSensor.AppendObservation(new float[] {
point.DeathAttr,
(int)point.navType,
@ -112,35 +104,6 @@ public class NPC : Agent, ICharacter
GameManager.IsHaveSeenByEnemy(AgentCharacter.Team.GetOppositeTeam(),
point.Position).ToInt()
});
=======
var parray = new float[]
{
//1 position in navpointId
(float) moveController.currentPosition.PointId,
//2 distance to flag
moveController.currentPosition.FlagDistance,
//3 death count in point
moveController.currentPosition.DeathAttr,
//4 flagEnemyDistance
GameManager.IsCloserToFlagFromNextNavPoint(point, transform.position) == true ? 1 : 0,
//5 EnemyVsNavPointDistance
GameManager.IsCloserToEnemyThanToNextNavPoint(point, transform.position, AgentCharacter.Team) == true
? 1
: 0
};
// var _parray = string.Join(" ", parray);
// Debug.Log("OBS: " + _parray);
bufferSensor.AppendObservation(parray);
}
}
public override void Heuristic(in ActionBuffers actionsOut)
{
var discreteActionsOut = actionsOut.DiscreteActions;
if (Input.GetKeyDown(KeyCode.W))
{
discreteActionsOut[0] = 1;
>>>>>>> 351fa8ee12c499a0374be71a192a5f288611f467
}
}
@ -149,7 +112,6 @@ public class NPC : Agent, ICharacter
var result = actions.DiscreteActions;
if (result[0] == 0)
{
<<<<<<< HEAD
if (navPointIdDict[moveController.PointStartID].navType != NavPointType.Cover)
return;
NpcState = CoverState;
@ -185,13 +147,6 @@ public class NPC : Agent, ICharacter
case 1: moveController.ReturnToStartPoint(); NpcState = RunningState; break;
default: throw new ArgumentException("Undefined Action recieved");
}
=======
moveController.MoveToRandomPoint();
NPC_State = RunningState;
} else if (actions.DiscreteActions[0] == 2)
{
moveController.MoveToPointById(actions.DiscreteActions[1]);
>>>>>>> 351fa8ee12c499a0374be71a192a5f288611f467
}
}
#endregion