Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented migration. The observed impact of this change is that mas…
…s extinctions are extremely rare now, and Locations get many more agents. (In fact, agents may be too survivable under current conditions.) 1. Added a migration event (based on PayUpkeepEvent). 2. Added Size to IAgent, and implemented the method in AgentBase 3. Added MigrationBaseChance to the ISimulation, and pushed the property through SimulationBase and GridSimulation 4. Implemented the migration logic in SimulationBase. 5. Updated the GUI with the new Migration setting.
- Loading branch information
1 parent
804d979
commit 8d18236
Showing
10 changed files
with
142 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace Cas.Core.Events | ||
{ | ||
public class MigrationEvent : PayUpkeepEvent | ||
{ | ||
public Guid OriginLocationId { get; set; } | ||
|
||
public MigrationEvent(Guid agentId, Guid originLocationId, Guid destinationLocationId, int cost, int generation) | ||
: base(agentId, destinationLocationId, cost, generation, "Migration") | ||
{ | ||
this.OriginLocationId = originLocationId; | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return string.Format("{0}: Migrated at a cost of {1} from location {2} to {3}", this.Generation, this.Cost, this.OriginLocationId, this.LocationId); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters