Skip to content

Commit

Permalink
Feature/herd behaviour 2 (#42)
Browse files Browse the repository at this point in the history
* removed hydration and starvation rate

* updated spawn files

---------

Co-authored-by: Johnny-MB <66835978+Johnny-MB@users.noreply.github.com>
  • Loading branch information
lorenzosenarigo and Johnny-MB authored Jan 28, 2024
1 parent a4b849e commit 150781a
Show file tree
Hide file tree
Showing 8 changed files with 1,460 additions and 244 deletions.
6 changes: 5 additions & 1 deletion GeoRasterBlueprint/Model/AbstractAnimal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,17 @@ public abstract class AbstractAnimal : IPositionable, IAgent<LandscapeLayer> {
public AnimalLifePeriod _LifePeriod;
public MattersOfDeath MatterOfDeath { get; private set; }
public bool IsAlive { get; set; } = true;

protected bool isLeading { get; }
protected int herdId { get; }

public static Random _random = new ();
private const int RandomWalkMaxDistanceInM = 500;
private const int RandomWalkMinDistanceInM = 10;
public const double MaxHydration = 100.0;
public const double MaxSatiety = 100.0;
public const double MaxSatiety = 100.0;
public const int MaxAge = 25;


public void Init(LandscapeLayer layer) {
LandscapeLayer = layer;
Expand Down
19 changes: 19 additions & 0 deletions GeoRasterBlueprint/Model/AbstractHerd.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System.Collections.Generic;

namespace GeoRasterBlueprint.Model;

public class AbstractHerd<T> where T : AbstractAnimal
{
public readonly List<T> Animals;

public AbstractHerd(int herdId, T leader, List<T> other)
{
Animals = other;
Id = herdId;
LeadingAnimal = leader;
}

private int Id { get; }
public T LeadingAnimal { get; }

}
3 changes: 3 additions & 0 deletions GeoRasterBlueprint/Model/Bison.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ public class Bison : AbstractAnimal {
[PropertyDescription(Name = "Longitude")]
public override double Longitude { get; set; }


protected string BisonType;

#endregion

#region Constants
Expand Down
2 changes: 2 additions & 0 deletions GeoRasterBlueprint/Model/Elk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public class Elk : AbstractAnimal {
[PropertyDescription(Name = "Longitude")]
public override double Longitude { get; set; }

protected string ElkType;

#endregion

#region constants
Expand Down
1 change: 1 addition & 0 deletions GeoRasterBlueprint/Model/Moose.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class Moose : AbstractAnimal {
[PropertyDescription(Name = "Longitude")]
public override double Longitude { get; set; }

protected string MooseType;
#endregion

#region Constants
Expand Down
620 changes: 539 additions & 81 deletions GeoRasterBlueprint/Resources/bisons.csv

Large diffs are not rendered by default.

658 changes: 577 additions & 81 deletions GeoRasterBlueprint/Resources/elks.csv

Large diffs are not rendered by default.

395 changes: 314 additions & 81 deletions GeoRasterBlueprint/Resources/moose.csv

Large diffs are not rendered by default.

0 comments on commit 150781a

Please sign in to comment.