Permalink
Browse files

archive

  • Loading branch information...
GandhiGames committed Sep 26, 2016
0 parents commit b9e6e5e5e8f35c2a62ed059be8a45c9128d95d9a
Showing with 5,030 additions and 0 deletions.
  1. +24 −0 Simulation/Simulation (1).sln
  2. +24 −0 Simulation/Simulation.sln
  3. +119 −0 Simulation/Simulation/Simulation/Agents/Agent.cs
  4. +356 −0 Simulation/Simulation/Simulation/Agents/MovingAgent.cs
  5. +243 −0 Simulation/Simulation/Simulation/Agents/Predator.cs
  6. +492 −0 Simulation/Simulation/Simulation/Agents/Prey.cs
  7. +469 −0 Simulation/Simulation/Simulation/Behaviour/BehaviourManager.cs
  8. +296 −0 Simulation/Simulation/Simulation/Behaviour/Behaviours.cs
  9. +24 −0 Simulation/Simulation/Simulation/Environment/Cell.cs
  10. +176 −0 Simulation/Simulation/Simulation/FileOutput.cs
  11. BIN Simulation/Simulation/Simulation/Game.ico
  12. BIN Simulation/Simulation/Simulation/GameThumbnail (1).png
  13. BIN Simulation/Simulation/Simulation/GameThumbnail.png
  14. +21 −0 Simulation/Simulation/Simulation/Genetic Algorithm/CrossOver.cs
  15. +251 −0 Simulation/Simulation/Simulation/Genetic Algorithm/GA_Pred.cs
  16. +306 −0 Simulation/Simulation/Simulation/Genetic Algorithm/GA_Prey.cs
  17. +32 −0 Simulation/Simulation/Simulation/Genetic Algorithm/GeneticAlgorithm.cs
  18. +154 −0 Simulation/Simulation/Simulation/InputManager.cs
  19. +214 −0 Simulation/Simulation/Simulation/Neural Network/NeuralNet.cs
  20. +44 −0 Simulation/Simulation/Simulation/Neural Network/Neuron.cs
  21. +42 −0 Simulation/Simulation/Simulation/Neural Network/NeuronLayer.cs
  22. +21 −0 Simulation/Simulation/Simulation/Program.cs
  23. +34 −0 Simulation/Simulation/Simulation/Properties/AssemblyInfo.cs
  24. +320 −0 Simulation/Simulation/Simulation/Simulation.cs
  25. +193 −0 Simulation/Simulation/Simulation/Simulation.csproj
  26. +7 −0 Simulation/Simulation/Simulation/Simulation.csproj.Debug.cachefile
  27. BIN Simulation/Simulation/Simulation/Simulation_TemporaryKey.pfx
  28. +278 −0 Simulation/Simulation/Simulation/Utilities.cs
  29. BIN Simulation/Simulation/Simulation/bin/x86/Debug/Content/Sprites/Sprite - Circle.xnb
  30. BIN Simulation/Simulation/Simulation/bin/x86/Debug/Content/Sprites/Sprite - MaxVelocity.xnb
  31. BIN Simulation/Simulation/Simulation/bin/x86/Debug/Content/Sprites/Sprite - Predator.xnb
  32. BIN Simulation/Simulation/Simulation/bin/x86/Debug/Content/Sprites/Sprite - Prey.xnb
  33. BIN Simulation/Simulation/Simulation/bin/x86/Debug/Content/Sprites/Sprite - Similar.xnb
  34. BIN Simulation/Simulation/Simulation/bin/x86/Debug/Content/Sprites/Sprite - Vegetation.xnb
  35. BIN Simulation/Simulation/Simulation/bin/x86/Debug/Content/spriteFont.xnb
  36. +22 −0 Simulation/Simulation/Simulation/bin/x86/Debug/Simulation.application
  37. +188 −0 Simulation/Simulation/Simulation/bin/x86/Debug/Simulation.exe.manifest
  38. BIN ...Debug/app.publish/Application Files/Simulation_1_0_0_0/Content/Sprites/Sprite - Circle.xnb.deploy
  39. BIN ...bug/app.publish/Application Files/Simulation_1_0_0_0/Content/Sprites/Sprite - Predator.xnb.deploy
  40. BIN ...6/Debug/app.publish/Application Files/Simulation_1_0_0_0/Content/Sprites/Sprite - Prey.xnb.deploy
  41. BIN ...g/app.publish/Application Files/Simulation_1_0_0_0/Content/Sprites/Sprite - Vegetation.xnb.deploy
  42. BIN ...tion/bin/x86/Debug/app.publish/Application Files/Simulation_1_0_0_0/Content/spriteFont.xnb.deploy
  43. BIN ...ulation/Simulation/bin/x86/Debug/app.publish/Application Files/Simulation_1_0_0_0/Game.ico.deploy
  44. BIN ...imulation/bin/x86/Debug/app.publish/Application Files/Simulation_1_0_0_0/GameThumbnail.png.deploy
  45. BIN ...n/Simulation/bin/x86/Debug/app.publish/Application Files/Simulation_1_0_0_0/Simulation.exe.deploy
  46. +170 −0 ...Simulation/bin/x86/Debug/app.publish/Application Files/Simulation_1_0_0_0/Simulation.exe.manifest
  47. +1 −0 Simulation/Simulation/Simulation/bin/x86/Debug/distance.js
  48. +1 −0 Simulation/Simulation/Simulation/bin/x86/Debug/timeAlive.js
  49. +1 −0 Simulation/Simulation/Simulation/bin/x86/Debug/velocity.js
  50. +1 −0 Simulation/Simulation/Simulation/bin/x86/Debug/weights.js
  51. +1 −0 Simulation/Simulation/Simulation/obj/x86/Debug/Microsoft.Xna.Framework.RuntimeProfile.txt
  52. +22 −0 Simulation/Simulation/Simulation/obj/x86/Debug/Simulation.application
  53. +17 −0 Simulation/Simulation/Simulation/obj/x86/Debug/Simulation.csproj.FileListAbsolute.txt
  54. +188 −0 Simulation/Simulation/Simulation/obj/x86/Debug/Simulation.exe.manifest
  55. +7 −0 ...mulation/Simulation/obj/x86/Debug/cachefile-{2B2ED0F3-B541-4615-82A5-9A367D93CDCB}-targetpath.txt
  56. +101 −0 Simulation/Simulation/SimulationContent/SimulationContent.contentproj
  57. BIN Simulation/Simulation/SimulationContent/Sprites/Sprite - Circle.png
  58. BIN Simulation/Simulation/SimulationContent/Sprites/Sprite - MaxVelocity.png
  59. BIN Simulation/Simulation/SimulationContent/Sprites/Sprite - Predator.png
  60. BIN Simulation/Simulation/SimulationContent/Sprites/Sprite - Prey.png
  61. BIN Simulation/Simulation/SimulationContent/Sprites/Sprite - Similar.png
  62. BIN Simulation/Simulation/SimulationContent/Sprites/Sprite - Vegetation.png
  63. +109 −0 Simulation/Simulation/SimulationContent/obj/x86/Debug/ContentPipeline.xml
  64. +1 −0 ...ion/Simulation/SimulationContent/obj/x86/Debug/SimulationContent.contentproj.FileListAbsolute.txt
  65. +60 −0 Simulation/Simulation/SimulationContent/spriteFont.spritefont
@@ -0,0 +1,24 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C# Express 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Simulation", "Simulation\Simulation\Simulation.csproj", "{80B857AD-906A-431A-A241-148EDD25E824}"
EndProject
Project("{96E2B04D-8817-42C6-938A-82C39BA4D311}") = "SimulationContent", "Simulation\SimulationContent\SimulationContent.contentproj", "{2B2ED0F3-B541-4615-82A5-9A367D93CDCB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{80B857AD-906A-431A-A241-148EDD25E824}.Debug|x86.ActiveCfg = Debug|x86
{80B857AD-906A-431A-A241-148EDD25E824}.Debug|x86.Build.0 = Debug|x86
{80B857AD-906A-431A-A241-148EDD25E824}.Release|x86.ActiveCfg = Release|x86
{80B857AD-906A-431A-A241-148EDD25E824}.Release|x86.Build.0 = Release|x86
{2B2ED0F3-B541-4615-82A5-9A367D93CDCB}.Debug|x86.ActiveCfg = Debug|x86
{2B2ED0F3-B541-4615-82A5-9A367D93CDCB}.Release|x86.ActiveCfg = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
@@ -0,0 +1,24 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C# Express 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Simulation", "Simulation\Simulation\Simulation.csproj", "{80B857AD-906A-431A-A241-148EDD25E824}"
EndProject
Project("{96E2B04D-8817-42C6-938A-82C39BA4D311}") = "SimulationContent", "Simulation\SimulationContent\SimulationContent.contentproj", "{2B2ED0F3-B541-4615-82A5-9A367D93CDCB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{80B857AD-906A-431A-A241-148EDD25E824}.Debug|x86.ActiveCfg = Debug|x86
{80B857AD-906A-431A-A241-148EDD25E824}.Debug|x86.Build.0 = Debug|x86
{80B857AD-906A-431A-A241-148EDD25E824}.Release|x86.ActiveCfg = Release|x86
{80B857AD-906A-431A-A241-148EDD25E824}.Release|x86.Build.0 = Release|x86
{2B2ED0F3-B541-4615-82A5-9A367D93CDCB}.Debug|x86.ActiveCfg = Debug|x86
{2B2ED0F3-B541-4615-82A5-9A367D93CDCB}.Release|x86.ActiveCfg = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
@@ -0,0 +1,119 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace Simulation
{
class Agent
{
#region Fields and Properties
private Texture2D defaultTexture;
public Texture2D DefaultTexture { get { return defaultTexture; } }
private Texture2D texture; //Image of agent
public Texture2D Texture { get { return texture; } set { texture = value; } }
private Color textureColour;
public Color TextureColour { get { return textureColour; } set { textureColour = value; } }
//Position of agent
protected Vector2 position;
public Vector2 Position
{
get
{
return position + imageCenter;
}
set
{
position = value;
}
}
//Radius used for collision
public float Radius { get { return Size / 2; } }
//Used to decide wether to display/update object
private Boolean isAlive;
public Boolean IsAlive { get { return isAlive; } set { isAlive = value; } }
//Energy of agent
protected float energy;
public float Energy { get { return energy; } set { energy = value; } }
//Size of texture depends on the energy level of agent
//Used as for analysing visually
private int size;
public int Size { get { return size; } set { size = value; } }
protected Vector2 imageCenter;
#endregion
#region Constructor
public Agent(Texture2D texture, Vector2 position, int size)
{
textureColour = Color.White;
this.texture = texture;
defaultTexture = texture;
this.position = position;
this.size = size;
//radius = size / 2;
isAlive = true;
imageCenter = new Vector2(size / 2f, size / 2f);
}
#endregion
#region Draw
public virtual void Draw(SpriteBatch spriteBatch)
{
imageCenter = new Vector2(size / 2f, size / 2f);
spriteBatch.Draw(texture,
new Rectangle((int)position.X, (int)position.Y, size, size), null, textureColour,
0f, imageCenter, SpriteEffects.None, 0f);
}
#endregion
#region Helper Methods
//Checks for collision
public virtual Boolean CheckCollision(Agent otherAgent)
{
float dx = Position.X - otherAgent.Position.X;
float dy = Position.Y - otherAgent.Position.Y;
float radii = otherAgent.Radius + Radius;
if ((dx * dx) + (dy * dy) < radii * radii)
{
return true;
}
else
{
return false;
}
}
public Boolean CheckCollision(Point p)
{
float dx = Position.X - p.X;
float dy = Position.Y - p.Y;
if ((dx * dx) + (dy * dy) < Radius * Radius)
{
return true;
}
else
{
return false;
}
}
#endregion
}
}
Oops, something went wrong.

0 comments on commit b9e6e5e

Please sign in to comment.