https://www.trccompsci.online/mediawiki/api.php?action=feedcontributions&user=Westy-Chan&feedformat=atomTRCCompSci - AQA Computer Science - User contributions [en-gb]2024-03-28T12:37:19ZUser contributionsMediaWiki 1.31.6https://www.trccompsci.online/mediawiki/index.php?title=User:Westy-Chan&diff=2571User:Westy-Chan2017-05-15T11:20:58Z<p>Westy-Chan: </p>
<hr />
<div>[[File:Circle.png|6900px]]</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=User:Westy-Chan&diff=2570User:Westy-Chan2017-05-15T11:20:10Z<p>Westy-Chan: </p>
<hr />
<div>[[File:Circle.png|10000px]]</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=User:Westy-Chan&diff=2569User:Westy-Chan2017-05-15T11:19:59Z<p>Westy-Chan: </p>
<hr />
<div>[[File:Circle.png|1000px]]</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=User:Westy-Chan&diff=2566User:Westy-Chan2017-05-15T11:17:12Z<p>Westy-Chan: </p>
<hr />
<div>[[File:Circle.png]]</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=User:Westy-Chan&diff=2565User:Westy-Chan2017-05-15T11:16:42Z<p>Westy-Chan: </p>
<hr />
<div>[[File: Circle.png]]</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=Implementing_weather_changes_that_affect_animals&diff=2116Implementing weather changes that affect animals2017-03-14T12:19:44Z<p>Westy-Chan: </p>
<hr />
<div>Check for which season you are in<br />
<syntaxhighlight lang="csharp"> <br />
if (menuOption == 1)<br />
{<br />
TimePeriod++;<br />
Season = TimePeriod % 4;<br />
ShowDetail = true;<br />
AdvanceTimePeriod();<br />
}<br />
if (menuOption == 2)<br />
{<br />
TimePeriod++;<br />
Season = TimePeriod % 4;<br />
ShowDetail = false;<br />
AdvanceTimePeriod();<br />
}<br />
</syntaxhighlight><br />
<br />
Winter Effects<br />
<syntaxhighlight lang="csharp"> <br />
<br />
private double DistanceBetween(int x1, int y1, int x2, int y2)<br />
{<br />
if (Season==0)<br />
{<br />
return (Math.Sqrt(Math.Pow(x1 - x2, 2) + Math.Pow(y1 - y2, 2))+3);<br />
}<br />
else<br />
return Math.Sqrt(Math.Pow(x1 - x2, 2) + Math.Pow(y1 - y2, 2));<br />
}<br />
</syntaxhighlight></div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=Implementing_weather_changes_that_affect_animals&diff=2115Implementing weather changes that affect animals2017-03-14T12:18:20Z<p>Westy-Chan: </p>
<hr />
<div><syntaxhighlight lang="csharp"> <br />
if (menuOption == 1)<br />
{<br />
TimePeriod++;<br />
Season = TimePeriod % 4;<br />
ShowDetail = true;<br />
AdvanceTimePeriod();<br />
}<br />
if (menuOption == 2)<br />
{<br />
TimePeriod++;<br />
Season = TimePeriod % 4;<br />
ShowDetail = false;<br />
AdvanceTimePeriod();<br />
}<br />
</syntaxhighlight><br />
<br />
Winter Effects<br />
<syntaxhighlight lang="csharp"> <br />
<br />
private double DistanceBetween(int x1, int y1, int x2, int y2)<br />
{<br />
if (Season==0)<br />
{<br />
return (Math.Sqrt(Math.Pow(x1 - x2, 2) + Math.Pow(y1 - y2, 2))+3);<br />
}<br />
else<br />
return Math.Sqrt(Math.Pow(x1 - x2, 2) + Math.Pow(y1 - y2, 2));<br />
}<br />
</syntaxhighlight></div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=Implementing_weather_changes_that_affect_animals&diff=2114Implementing weather changes that affect animals2017-03-14T12:18:07Z<p>Westy-Chan: </p>
<hr />
<div><syntaxhighlight lang="csharp"> <br />
if (menuOption == 1)<br />
{<br />
TimePeriod++;<br />
Season = TimePeriod % 4;<br />
ShowDetail = true;<br />
AdvanceTimePeriod();<br />
}<br />
if (menuOption == 2)<br />
{<br />
TimePeriod++;<br />
Season = TimePeriod % 4;<br />
ShowDetail = false;<br />
AdvanceTimePeriod();<br />
}<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="csharp"> <br />
<br />
private double DistanceBetween(int x1, int y1, int x2, int y2)<br />
{<br />
if (Season==0)<br />
{<br />
return (Math.Sqrt(Math.Pow(x1 - x2, 2) + Math.Pow(y1 - y2, 2))+3);<br />
}<br />
else<br />
return Math.Sqrt(Math.Pow(x1 - x2, 2) + Math.Pow(y1 - y2, 2));<br />
}<br />
</syntaxhighlight></div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=Implementing_weather_changes_that_affect_animals&diff=2110Implementing weather changes that affect animals2017-03-14T12:16:08Z<p>Westy-Chan: </p>
<hr />
<div><syntaxhighlight lang="csharp"> <br />
if (menuOption == 1)<br />
{<br />
TimePeriod++;<br />
Season = TimePeriod % 4;<br />
ShowDetail = true;<br />
AdvanceTimePeriod();<br />
}<br />
if (menuOption == 2)<br />
{<br />
TimePeriod++;<br />
Season = TimePeriod % 4;<br />
ShowDetail = false;<br />
AdvanceTimePeriod();<br />
}<br />
</syntaxhighlight></div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=Implementing_weather_changes_that_affect_animals&diff=2109Implementing weather changes that affect animals2017-03-14T12:15:28Z<p>Westy-Chan: </p>
<hr />
<div><syntaxhighlight lang="csharp"> <br />
if (menuOption == 1)<br />
{<br />
TimePeriod++;<br />
Season = TimePeriod % 4;<br />
ShowDetail = true;<br />
AdvanceTimePeriod();<br />
}<br />
if (menuOption == 2)<br />
{<br />
TimePeriod++;<br />
Season = TimePeriod % 4;<br />
ShowDetail = false;<br />
AdvanceTimePeriod();<br />
}<br />
<br />
<br />
<br />
<br />
</syntaxhighlight></div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=Implementing_weather_changes_that_affect_animals&diff=2108Implementing weather changes that affect animals2017-03-14T12:15:06Z<p>Westy-Chan: /* public */</p>
<hr />
<div>Will lead into Storms and fires<br />
Weather chance to be certain things (storm, rain, sun, neutral,)<br />
class weather<br />
==private==<br />
variability float<br />
stormradius float<br />
<br />
<syntaxhighlight lang="csharp"> <br />
if (menuOption == 1)<br />
{<br />
TimePeriod++;<br />
Season = TimePeriod % 4;<br />
ShowDetail = true;<br />
AdvanceTimePeriod();<br />
}<br />
if (menuOption == 2)<br />
{<br />
TimePeriod++;<br />
Season = TimePeriod % 4;<br />
ShowDetail = false;<br />
AdvanceTimePeriod();<br />
}<br />
<br />
<br />
<br />
<br />
</syntaxhighlight></div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=User:Westy-Chan&diff=2103User:Westy-Chan2017-03-13T14:54:16Z<p>Westy-Chan: Westy-Chan moved page User:Westy to User:Westy-Chan: Automatically moved page while renaming the user "Westy" to "Westy-Chan"</p>
<hr />
<div></div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=User:Westy&diff=2104User:Westy2017-03-13T14:54:16Z<p>Westy-Chan: Westy-Chan moved page User:Westy to User:Westy-Chan: Automatically moved page while renaming the user "Westy" to "Westy-Chan"</p>
<hr />
<div>#REDIRECT [[User:Westy-Chan]]</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=Implementing_weather_changes_that_affect_animals&diff=1512Implementing weather changes that affect animals2017-02-14T12:48:57Z<p>Westy-Chan: </p>
<hr />
<div>Will lead into Storms and fires<br />
Weather chance to be certain things (storm, rain, sun, neutral,)<br />
class weather<br />
==private==<br />
variability float<br />
stormradius float<br />
<br />
==public==<br />
storm<br />
{<br />
}<br />
<br />
rain<br />
{<br />
}<br />
<br />
sun<br />
{<br />
}<br />
<br />
neutral<br />
{<br />
keep same<br />
}</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=Implementing_weather_changes_that_affect_animals&diff=1509Implementing weather changes that affect animals2017-02-14T12:32:53Z<p>Westy-Chan: Created page with "Will lead into Storms and fires"</p>
<hr />
<div>Will lead into Storms and fires</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=Section_D_2017&diff=1508Section D 20172017-02-14T12:28:51Z<p>Westy-Chan: </p>
<hr />
<div>=Introduction=<br />
You are advised to spend no more than 70 minutes on this section. Questions will use the Skeleton Program and the Preliminary Material.<br />
<br />
This page will identify some of the alterations / improvements that can be made to the skeleton program. It is important to explain what problem the alteration is tackling, and explain how to make the improvement itself.<br />
<br />
=Improvements=<br />
# [[Add the code to allow foxes to have a gender]]<br />
# [[Make the probability of a rabbit dying increase with age, ie extra 5% per term]]<br />
# [[Reduce the reproductive rate of a rabbit with age]]<br />
# [[ Add a way for a disease to kill rabbits in warrens]]<br />
# [[Implementing weather changes that affect animals]]<br />
# [[Storm or fire affects number of animals in a certain radius]]<br />
# [[Validation for menu options for the coordinate input]]<br />
# [[Constraints for number of animals placed (when option two is selected)]]<br />
# [[Display a message when a cell with no fox is selected for fox inspection...Adding a loop too]]<br />
# [[Display a message when a cell with no warren is selected for warren inspection...Adding a loop too]]<br />
# [[A fox moves in a random direction if they haven't eaten enough food that turn]]<br />
# [[Foxes have a random chance to move towards the closest warren each time period]]<br />
# [[If a fox eats more food than it needs its reproduction rate/coefficient increases]]<br />
<br />
=Extension of the Skeleton Program=<br />
One question is likely to focus on adding new features and functionality to the program. With the skeleton program and the way it is written this is likely to be to create another prey animal for the fox. This section will document how to achieve this. Other extensions will also be covered over time.</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=Add_the_code_to_allow_foxes_to_have_a_gender&diff=1507Add the code to allow foxes to have a gender2017-02-14T12:13:12Z<p>Westy-Chan: Reverted edits by Westy (talk) to last revision by Admin</p>
<hr />
<div>==Explanation==<br />
I have looked at the code for a rabbit and copied the code relating to gender over into the fox class.<br />
<br />
Firstly you need to add the is to the start of the class:<br />
<br />
<syntaxhighlight lang="csharp" line><br />
enum Genders<br />
{<br />
Male,<br />
Female<br />
}<br />
<br />
private Genders Gender;<br />
</syntaxhighlight><br />
<br />
This creates the different enum options, Genders can either be Male or Female. The Gender of the object is created using private.<br />
<br />
This is the method from the rabbit class to check if an object is female. Copy the entire method into the fox class:<br />
<br />
<syntaxhighlight lang="csharp" line><br />
public bool IsFemale()<br />
{<br />
if (Gender == Genders.Female)<br />
{<br />
return true;<br />
}<br />
else<br />
{<br />
return false;<br />
}<br />
}<br />
</syntaxhighlight><br />
<br />
In order to assign a Gender to a fox the code below needs to be added to the fox constructor:<br />
<br />
<br />
<syntaxhighlight lang="csharp" line><br />
if (Rnd.Next(0, 100) < 50)<br />
{<br />
Gender = Genders.Male;<br />
}<br />
else<br />
{<br />
Gender = Genders.Female;<br />
}<br />
</syntaxhighlight><br />
<br />
In the inspect method add this line to display the Gender of the fox:<br />
<br />
<syntaxhighlight lang="csharp" line><br />
Console.Write("Gender " + Gender + " ");<br />
</syntaxhighlight><br />
<br />
==What Now??==<br />
To use the new Gender you can change how the fox is reproduced:<br />
<br />
<syntaxhighlight lang="csharp" line><br />
public bool ReproduceThisPeriod()<br />
{<br />
const double ReproductionProbability = 0.60;<br />
if (Rnd.Next(0, 100) < ReproductionProbability * 100 && IsFemale())<br />
{<br />
return true;<br />
}<br />
else<br />
{<br />
return false;<br />
}<br />
}<br />
</syntaxhighlight><br />
<br />
This has made it so only a female fox can reproduce. But I have increased the probability.</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=Add_the_code_to_allow_foxes_to_have_a_gender&diff=1504Add the code to allow foxes to have a gender2017-02-14T12:05:57Z<p>Westy-Chan: /* Explanation */</p>
<hr />
<div>==Explanation==<br />
I have looked at the code for a rabbit and copied the code relating to gender over into the fox class.<br />
<br />
Firstly you need to add the is to the start of the class:<br />
<br />
<syntaxhighlight lang="csharp" line><br />
enum Genders<br />
{<br />
Male,<br />
Female<br />
Agender<br />
Androgyne<br />
Androgynous<br />
Bigender<br />
Cis<br />
Cisgender<br />
Cis Female<br />
Cis Male<br />
Cis Man<br />
Cis Woman<br />
Cisgender Female<br />
Cisgender Male<br />
Cisgender Man<br />
Cisgender Woman<br />
Female to Male<br />
FTM<br />
Gender Fluid<br />
Gender Nonconforming<br />
Gender Questioning<br />
Gender Variant<br />
Genderqueer<br />
Intersex<br />
Male to Female<br />
MTF<br />
Neither<br />
Neutrois<br />
Non-binary<br />
Other<br />
Pangender<br />
Trans<br />
Trans*<br />
Trans Female<br />
Trans* Female<br />
Trans Male<br />
Trans* Male<br />
Trans Man<br />
Trans* Man<br />
Trans Person<br />
Trans* Person<br />
Trans Woman<br />
Trans* Woman<br />
Transfeminine<br />
Transgender<br />
Transgender Female<br />
Transgender Male<br />
Transgender Man<br />
Transgender Person<br />
Transgender Woman<br />
Transmasculine<br />
Transsexual<br />
Transsexual Female<br />
Transsexual Male<br />
Transsexual Man<br />
Transsexual Person<br />
Transsexual Woman<br />
Two-Spirit<br />
<br />
}<br />
<br />
private Genders Gender;<br />
</syntaxhighlight><br />
<br />
This creates the different enum options, Genders can either be Male or Female. The Gender of the object is created using private.<br />
<br />
This is the method from the rabbit class to check if an object is female. Copy the entire method into the fox class:<br />
<br />
<syntaxhighlight lang="csharp" line><br />
public bool IsFemale()<br />
{<br />
if (Gender == Genders.Female)<br />
{<br />
return true;<br />
}<br />
else<br />
{<br />
return false;<br />
}<br />
}<br />
</syntaxhighlight><br />
<br />
In order to assign a Gender to a fox the code below needs to be added to the fox constructor:<br />
<br />
<br />
<syntaxhighlight lang="csharp" line><br />
if (Rnd.Next(0, 100) < 50)<br />
{<br />
Gender = Genders.Male;<br />
}<br />
else<br />
{<br />
Gender = Genders.Female;<br />
}<br />
</syntaxhighlight><br />
<br />
In the inspect method add this line to display the Gender of the fox:<br />
<br />
<syntaxhighlight lang="csharp" line><br />
Console.Write("Gender " + Gender + " ");<br />
</syntaxhighlight><br />
<br />
==What Now??==<br />
To use the new Gender you can change how the fox is reproduced:<br />
<br />
<syntaxhighlight lang="csharp" line><br />
public bool ReproduceThisPeriod()<br />
{<br />
const double ReproductionProbability = 0.60;<br />
if (Rnd.Next(0, 100) < ReproductionProbability * 100 && IsFemale())<br />
{<br />
return true;<br />
}<br />
else<br />
{<br />
return false;<br />
}<br />
}<br />
</syntaxhighlight><br />
<br />
This has made it so only a female fox can reproduce. But I have increased the probability.</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=Fox_(Sub_Class_of_Animal)&diff=1428Fox (Sub Class of Animal)2017-02-07T12:30:10Z<p>Westy-Chan: /* Methods */</p>
<hr />
<div><br />
==The Code==<br />
<tabber><br />
C#=<br />
<syntaxhighlight lang="csharp" line><br />
class Fox : Animal<br />
{<br />
private int FoodUnitsNeeded = 10;<br />
private int FoodUnitsConsumedThisPeriod = 0;<br />
private const int DefaultLifespan = 7;<br />
private const double DefaultProbabilityDeathOtherCauses = 0.1;<br />
<br />
public Fox(int Variability)<br />
: base(DefaultLifespan, DefaultProbabilityDeathOtherCauses, Variability)<br />
{<br />
FoodUnitsNeeded = (int)(10 * base.CalculateRandomValue(100, Variability) / 100);<br />
}<br />
<br />
public void AdvanceGeneration(bool ShowDetail)<br />
{<br />
if (FoodUnitsConsumedThisPeriod == 0)<br />
{<br />
IsAlive = false;<br />
if (ShowDetail)<br />
{<br />
Console.WriteLine(" Fox dies as has eaten no food this period.");<br />
}<br />
}<br />
else<br />
{<br />
if (CheckIfKilledByOtherFactor())<br />
{<br />
IsAlive = false;<br />
if (ShowDetail)<br />
{<br />
Console.WriteLine(" Fox killed by other factor.");<br />
}<br />
}<br />
else<br />
{<br />
if (FoodUnitsConsumedThisPeriod < FoodUnitsNeeded)<br />
{<br />
CalculateNewAge();<br />
if (ShowDetail)<br />
{<br />
Console.WriteLine(" Fox ages further due to lack of food.");<br />
}<br />
}<br />
CalculateNewAge();<br />
if (!IsAlive)<br />
{<br />
if (ShowDetail)<br />
{<br />
Console.WriteLine(" Fox has died of old age.");<br />
}<br />
}<br />
}<br />
}<br />
}<br />
<br />
public void ResetFoodConsumed()<br />
{<br />
FoodUnitsConsumedThisPeriod = 0;<br />
}<br />
<br />
public bool ReproduceThisPeriod()<br />
{<br />
const double ReproductionProbability = 0.25;<br />
if (Rnd.Next(0, 100) < ReproductionProbability * 100)<br />
{<br />
return true;<br />
}<br />
else<br />
{<br />
return false;<br />
}<br />
}<br />
<br />
public void GiveFood(int FoodUnits)<br />
{<br />
FoodUnitsConsumedThisPeriod = FoodUnitsConsumedThisPeriod + FoodUnits;<br />
}<br />
<br />
public override void Inspect()<br />
{<br />
base.Inspect();<br />
Console.Write("Food needed " + FoodUnitsNeeded + " ");<br />
Console.Write("Food eaten " + FoodUnitsConsumedThisPeriod + " ");<br />
Console.WriteLine();<br />
}<br />
}<br />
<br />
</syntaxhighlight><br />
|-|<br />
VB=<br />
<syntaxhighlight lang="vbnet" line><br />
<br />
</syntaxhighlight><br />
</tabber><br />
=Explanation=<br />
=='''Attributes ;_;'''==<br />
<br />
=== FoodUnitsNeeded ;_;=== <br />
The amount of food needed per period, but this current value is just the default and can change based on the formula in the animal class.<br />
<br />
=== FoodUnitsConsumedThisPeriod ;_;===<br />
This value is the amount of food eaten this period.<br />
<br />
=== DefaultLifespan ;_; ===<br />
The average lifespan of the Animal sub class Fox but of course there is some variance.<br />
<br />
=== DefaultProbabilityDeathOtherCauses ;_; ===<br />
The default chance that the fox will die to causes other than starvation or old age.<br />
<br />
=='''Methods ;_;'''==<br />
<br />
===Fox ;_;===<br />
This method creates a fox using its base class Animal, with the lifespan and death from other causes probability of fox and Variability stated in the program.<br />
<br />
===AdvanceGeneration ;_;===</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=Fox_(Sub_Class_of_Animal)&diff=1425Fox (Sub Class of Animal)2017-02-07T12:13:37Z<p>Westy-Chan: /* Methods */</p>
<hr />
<div><br />
==The Code==<br />
<tabber><br />
C#=<br />
<syntaxhighlight lang="csharp" line><br />
class Fox : Animal<br />
{<br />
private int FoodUnitsNeeded = 10;<br />
private int FoodUnitsConsumedThisPeriod = 0;<br />
private const int DefaultLifespan = 7;<br />
private const double DefaultProbabilityDeathOtherCauses = 0.1;<br />
<br />
public Fox(int Variability)<br />
: base(DefaultLifespan, DefaultProbabilityDeathOtherCauses, Variability)<br />
{<br />
FoodUnitsNeeded = (int)(10 * base.CalculateRandomValue(100, Variability) / 100);<br />
}<br />
<br />
public void AdvanceGeneration(bool ShowDetail)<br />
{<br />
if (FoodUnitsConsumedThisPeriod == 0)<br />
{<br />
IsAlive = false;<br />
if (ShowDetail)<br />
{<br />
Console.WriteLine(" Fox dies as has eaten no food this period.");<br />
}<br />
}<br />
else<br />
{<br />
if (CheckIfKilledByOtherFactor())<br />
{<br />
IsAlive = false;<br />
if (ShowDetail)<br />
{<br />
Console.WriteLine(" Fox killed by other factor.");<br />
}<br />
}<br />
else<br />
{<br />
if (FoodUnitsConsumedThisPeriod < FoodUnitsNeeded)<br />
{<br />
CalculateNewAge();<br />
if (ShowDetail)<br />
{<br />
Console.WriteLine(" Fox ages further due to lack of food.");<br />
}<br />
}<br />
CalculateNewAge();<br />
if (!IsAlive)<br />
{<br />
if (ShowDetail)<br />
{<br />
Console.WriteLine(" Fox has died of old age.");<br />
}<br />
}<br />
}<br />
}<br />
}<br />
<br />
public void ResetFoodConsumed()<br />
{<br />
FoodUnitsConsumedThisPeriod = 0;<br />
}<br />
<br />
public bool ReproduceThisPeriod()<br />
{<br />
const double ReproductionProbability = 0.25;<br />
if (Rnd.Next(0, 100) < ReproductionProbability * 100)<br />
{<br />
return true;<br />
}<br />
else<br />
{<br />
return false;<br />
}<br />
}<br />
<br />
public void GiveFood(int FoodUnits)<br />
{<br />
FoodUnitsConsumedThisPeriod = FoodUnitsConsumedThisPeriod + FoodUnits;<br />
}<br />
<br />
public override void Inspect()<br />
{<br />
base.Inspect();<br />
Console.Write("Food needed " + FoodUnitsNeeded + " ");<br />
Console.Write("Food eaten " + FoodUnitsConsumedThisPeriod + " ");<br />
Console.WriteLine();<br />
}<br />
}<br />
<br />
</syntaxhighlight><br />
|-|<br />
VB=<br />
<syntaxhighlight lang="vbnet" line><br />
<br />
</syntaxhighlight><br />
</tabber><br />
=Explanation=<br />
=='''Attributes ;_;'''==<br />
<br />
=== FoodUnitsNeeded ;_;=== <br />
The amount of food needed per period, but this current value is just the default and can change based on the formula in the animal class.<br />
<br />
=== FoodUnitsConsumedThisPeriod ;_;===<br />
This value is the amount of food eaten this period.<br />
<br />
=== DefaultLifespan ;_; ===<br />
The average lifespan of the Animal sub class Fox but of course there is some variance.<br />
<br />
=== DefaultProbabilityDeathOtherCauses ;_; ===<br />
The default chance that the fox will die to causes other than starvation or old age.<br />
<br />
=='''Methods'''==<br />
<br />
===Fox===<br />
This method creates a fox using its base class Animal, with the lifespan and death from other causes probability of fox and Variability stated in the program.<br />
<br />
===AdvanceGeneration===</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=Fox_(Sub_Class_of_Animal)&diff=1413Fox (Sub Class of Animal)2017-02-06T14:51:41Z<p>Westy-Chan: Reverted edits by Cameron (talk) to last revision by Westy</p>
<hr />
<div><br />
==The Code==<br />
<tabber><br />
C#=<br />
<syntaxhighlight lang="csharp" line><br />
class Fox : Animal<br />
{<br />
private int FoodUnitsNeeded = 10;<br />
private int FoodUnitsConsumedThisPeriod = 0;<br />
private const int DefaultLifespan = 7;<br />
private const double DefaultProbabilityDeathOtherCauses = 0.1;<br />
<br />
public Fox(int Variability)<br />
: base(DefaultLifespan, DefaultProbabilityDeathOtherCauses, Variability)<br />
{<br />
FoodUnitsNeeded = (int)(10 * base.CalculateRandomValue(100, Variability) / 100);<br />
}<br />
<br />
public void AdvanceGeneration(bool ShowDetail)<br />
{<br />
if (FoodUnitsConsumedThisPeriod == 0)<br />
{<br />
IsAlive = false;<br />
if (ShowDetail)<br />
{<br />
Console.WriteLine(" Fox dies as has eaten no food this period.");<br />
}<br />
}<br />
else<br />
{<br />
if (CheckIfKilledByOtherFactor())<br />
{<br />
IsAlive = false;<br />
if (ShowDetail)<br />
{<br />
Console.WriteLine(" Fox killed by other factor.");<br />
}<br />
}<br />
else<br />
{<br />
if (FoodUnitsConsumedThisPeriod < FoodUnitsNeeded)<br />
{<br />
CalculateNewAge();<br />
if (ShowDetail)<br />
{<br />
Console.WriteLine(" Fox ages further due to lack of food.");<br />
}<br />
}<br />
CalculateNewAge();<br />
if (!IsAlive)<br />
{<br />
if (ShowDetail)<br />
{<br />
Console.WriteLine(" Fox has died of old age.");<br />
}<br />
}<br />
}<br />
}<br />
}<br />
<br />
public void ResetFoodConsumed()<br />
{<br />
FoodUnitsConsumedThisPeriod = 0;<br />
}<br />
<br />
public bool ReproduceThisPeriod()<br />
{<br />
const double ReproductionProbability = 0.25;<br />
if (Rnd.Next(0, 100) < ReproductionProbability * 100)<br />
{<br />
return true;<br />
}<br />
else<br />
{<br />
return false;<br />
}<br />
}<br />
<br />
public void GiveFood(int FoodUnits)<br />
{<br />
FoodUnitsConsumedThisPeriod = FoodUnitsConsumedThisPeriod + FoodUnits;<br />
}<br />
<br />
public override void Inspect()<br />
{<br />
base.Inspect();<br />
Console.Write("Food needed " + FoodUnitsNeeded + " ");<br />
Console.Write("Food eaten " + FoodUnitsConsumedThisPeriod + " ");<br />
Console.WriteLine();<br />
}<br />
}<br />
<br />
</syntaxhighlight><br />
|-|<br />
VB=<br />
<syntaxhighlight lang="vbnet" line><br />
<br />
</syntaxhighlight><br />
</tabber><br />
=Explanation=<br />
=='''Attributes ;_;'''==<br />
<br />
=== FoodUnitsNeeded ;_;=== <br />
The amount of food needed per period, but this current value is just the default and can change based on the formula in the animal class.<br />
<br />
=== FoodUnitsConsumedThisPeriod ;_;===<br />
This value is the amount of food eaten this period.<br />
<br />
=== DefaultLifespan ;_; ===<br />
The average lifespan of the Animal sub class Fox but of course there is some variance.<br />
<br />
=== DefaultProbabilityDeathOtherCauses ;_; ===<br />
The default chance that the fox will die to causes other than starvation or old age.<br />
<br />
=='''Methods'''==</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=Fox_(Sub_Class_of_Animal)&diff=1411Fox (Sub Class of Animal)2017-02-06T14:51:15Z<p>Westy-Chan: Reverted edits by Cameron (talk) to last revision by Westy</p>
<hr />
<div><br />
==The Code==<br />
<tabber><br />
C#=<br />
<syntaxhighlight lang="csharp" line><br />
class Fox : Animal<br />
{<br />
private int FoodUnitsNeeded = 10;<br />
private int FoodUnitsConsumedThisPeriod = 0;<br />
private const int DefaultLifespan = 7;<br />
private const double DefaultProbabilityDeathOtherCauses = 0.1;<br />
<br />
public Fox(int Variability)<br />
: base(DefaultLifespan, DefaultProbabilityDeathOtherCauses, Variability)<br />
{<br />
FoodUnitsNeeded = (int)(10 * base.CalculateRandomValue(100, Variability) / 100);<br />
}<br />
<br />
public void AdvanceGeneration(bool ShowDetail)<br />
{<br />
if (FoodUnitsConsumedThisPeriod == 0)<br />
{<br />
IsAlive = false;<br />
if (ShowDetail)<br />
{<br />
Console.WriteLine(" Fox dies as has eaten no food this period.");<br />
}<br />
}<br />
else<br />
{<br />
if (CheckIfKilledByOtherFactor())<br />
{<br />
IsAlive = false;<br />
if (ShowDetail)<br />
{<br />
Console.WriteLine(" Fox killed by other factor.");<br />
}<br />
}<br />
else<br />
{<br />
if (FoodUnitsConsumedThisPeriod < FoodUnitsNeeded)<br />
{<br />
CalculateNewAge();<br />
if (ShowDetail)<br />
{<br />
Console.WriteLine(" Fox ages further due to lack of food.");<br />
}<br />
}<br />
CalculateNewAge();<br />
if (!IsAlive)<br />
{<br />
if (ShowDetail)<br />
{<br />
Console.WriteLine(" Fox has died of old age.");<br />
}<br />
}<br />
}<br />
}<br />
}<br />
<br />
public void ResetFoodConsumed()<br />
{<br />
FoodUnitsConsumedThisPeriod = 0;<br />
}<br />
<br />
public bool ReproduceThisPeriod()<br />
{<br />
const double ReproductionProbability = 0.25;<br />
if (Rnd.Next(0, 100) < ReproductionProbability * 100)<br />
{<br />
return true;<br />
}<br />
else<br />
{<br />
return false;<br />
}<br />
}<br />
<br />
public void GiveFood(int FoodUnits)<br />
{<br />
FoodUnitsConsumedThisPeriod = FoodUnitsConsumedThisPeriod + FoodUnits;<br />
}<br />
<br />
public override void Inspect()<br />
{<br />
base.Inspect();<br />
Console.Write("Food needed " + FoodUnitsNeeded + " ");<br />
Console.Write("Food eaten " + FoodUnitsConsumedThisPeriod + " ");<br />
Console.WriteLine();<br />
}<br />
}<br />
<br />
</syntaxhighlight><br />
|-|<br />
VB=<br />
<syntaxhighlight lang="vbnet" line><br />
<br />
</syntaxhighlight><br />
</tabber><br />
=Explanation=<br />
=='''Attributes ;_;'''==<br />
<br />
=== FoodUnitsNeeded ;_;=== <br />
The amount of food needed per period, but this current value is just the default and can change based on the formula in the animal class.<br />
<br />
=== FoodUnitsConsumedThisPeriod ;_;===<br />
This value is the amount of food eaten this period.<br />
<br />
=== DefaultLifespan ;_; ===<br />
The average lifespan of the Animal sub class Fox but of course there is some variance.<br />
<br />
=== DefaultProbabilityDeathOtherCauses ;_; ===<br />
The default chance that the fox will die to causes other than starvation or old age.<br />
<br />
=='''Methods'''==</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=Fox_(Sub_Class_of_Animal)&diff=1405Fox (Sub Class of Animal)2017-02-06T14:42:20Z<p>Westy-Chan: /* Explanation */</p>
<hr />
<div><br />
==The Code==<br />
<tabber><br />
C#=<br />
<syntaxhighlight lang="csharp" line><br />
class Fox : Animal<br />
{<br />
private int FoodUnitsNeeded = 10;<br />
private int FoodUnitsConsumedThisPeriod = 0;<br />
private const int DefaultLifespan = 7;<br />
private const double DefaultProbabilityDeathOtherCauses = 0.1;<br />
<br />
public Fox(int Variability)<br />
: base(DefaultLifespan, DefaultProbabilityDeathOtherCauses, Variability)<br />
{<br />
FoodUnitsNeeded = (int)(10 * base.CalculateRandomValue(100, Variability) / 100);<br />
}<br />
<br />
public void AdvanceGeneration(bool ShowDetail)<br />
{<br />
if (FoodUnitsConsumedThisPeriod == 0)<br />
{<br />
IsAlive = false;<br />
if (ShowDetail)<br />
{<br />
Console.WriteLine(" Fox dies as has eaten no food this period.");<br />
}<br />
}<br />
else<br />
{<br />
if (CheckIfKilledByOtherFactor())<br />
{<br />
IsAlive = false;<br />
if (ShowDetail)<br />
{<br />
Console.WriteLine(" Fox killed by other factor.");<br />
}<br />
}<br />
else<br />
{<br />
if (FoodUnitsConsumedThisPeriod < FoodUnitsNeeded)<br />
{<br />
CalculateNewAge();<br />
if (ShowDetail)<br />
{<br />
Console.WriteLine(" Fox ages further due to lack of food.");<br />
}<br />
}<br />
CalculateNewAge();<br />
if (!IsAlive)<br />
{<br />
if (ShowDetail)<br />
{<br />
Console.WriteLine(" Fox has died of old age.");<br />
}<br />
}<br />
}<br />
}<br />
}<br />
<br />
public void ResetFoodConsumed()<br />
{<br />
FoodUnitsConsumedThisPeriod = 0;<br />
}<br />
<br />
public bool ReproduceThisPeriod()<br />
{<br />
const double ReproductionProbability = 0.25;<br />
if (Rnd.Next(0, 100) < ReproductionProbability * 100)<br />
{<br />
return true;<br />
}<br />
else<br />
{<br />
return false;<br />
}<br />
}<br />
<br />
public void GiveFood(int FoodUnits)<br />
{<br />
FoodUnitsConsumedThisPeriod = FoodUnitsConsumedThisPeriod + FoodUnits;<br />
}<br />
<br />
public override void Inspect()<br />
{<br />
base.Inspect();<br />
Console.Write("Food needed " + FoodUnitsNeeded + " ");<br />
Console.Write("Food eaten " + FoodUnitsConsumedThisPeriod + " ");<br />
Console.WriteLine();<br />
}<br />
}<br />
<br />
</syntaxhighlight><br />
|-|<br />
VB=<br />
<syntaxhighlight lang="vbnet" line><br />
<br />
</syntaxhighlight><br />
</tabber><br />
=Explanation=<br />
=='''Attributes ;_;'''==<br />
<br />
=== FoodUnitsNeeded ;_;=== <br />
The amount of food needed per period, but this current value is just the default and can change based on the formula in the animal class.<br />
<br />
=== FoodUnitsConsumedThisPeriod ;_;===<br />
This value is the amount of food eaten this period.<br />
<br />
=== DefaultLifespan ;_; ===<br />
The average lifespan of the Animal sub class Fox but of course there is some variance.<br />
<br />
=== DefaultProbabilityDeathOtherCauses ;_; ===<br />
The default chance that the fox will die to causes other than starvation or old age.<br />
<br />
=='''Methods'''==</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=Fox_(Sub_Class_of_Animal)&diff=1399Fox (Sub Class of Animal)2017-02-06T14:33:46Z<p>Westy-Chan: /* Explanation */</p>
<hr />
<div><br />
==The Code==<br />
<tabber><br />
C#=<br />
<syntaxhighlight lang="csharp" line><br />
class Fox : Animal<br />
{<br />
private int FoodUnitsNeeded = 10;<br />
private int FoodUnitsConsumedThisPeriod = 0;<br />
private const int DefaultLifespan = 7;<br />
private const double DefaultProbabilityDeathOtherCauses = 0.1;<br />
<br />
public Fox(int Variability)<br />
: base(DefaultLifespan, DefaultProbabilityDeathOtherCauses, Variability)<br />
{<br />
FoodUnitsNeeded = (int)(10 * base.CalculateRandomValue(100, Variability) / 100);<br />
}<br />
<br />
public void AdvanceGeneration(bool ShowDetail)<br />
{<br />
if (FoodUnitsConsumedThisPeriod == 0)<br />
{<br />
IsAlive = false;<br />
if (ShowDetail)<br />
{<br />
Console.WriteLine(" Fox dies as has eaten no food this period.");<br />
}<br />
}<br />
else<br />
{<br />
if (CheckIfKilledByOtherFactor())<br />
{<br />
IsAlive = false;<br />
if (ShowDetail)<br />
{<br />
Console.WriteLine(" Fox killed by other factor.");<br />
}<br />
}<br />
else<br />
{<br />
if (FoodUnitsConsumedThisPeriod < FoodUnitsNeeded)<br />
{<br />
CalculateNewAge();<br />
if (ShowDetail)<br />
{<br />
Console.WriteLine(" Fox ages further due to lack of food.");<br />
}<br />
}<br />
CalculateNewAge();<br />
if (!IsAlive)<br />
{<br />
if (ShowDetail)<br />
{<br />
Console.WriteLine(" Fox has died of old age.");<br />
}<br />
}<br />
}<br />
}<br />
}<br />
<br />
public void ResetFoodConsumed()<br />
{<br />
FoodUnitsConsumedThisPeriod = 0;<br />
}<br />
<br />
public bool ReproduceThisPeriod()<br />
{<br />
const double ReproductionProbability = 0.25;<br />
if (Rnd.Next(0, 100) < ReproductionProbability * 100)<br />
{<br />
return true;<br />
}<br />
else<br />
{<br />
return false;<br />
}<br />
}<br />
<br />
public void GiveFood(int FoodUnits)<br />
{<br />
FoodUnitsConsumedThisPeriod = FoodUnitsConsumedThisPeriod + FoodUnits;<br />
}<br />
<br />
public override void Inspect()<br />
{<br />
base.Inspect();<br />
Console.Write("Food needed " + FoodUnitsNeeded + " ");<br />
Console.Write("Food eaten " + FoodUnitsConsumedThisPeriod + " ");<br />
Console.WriteLine();<br />
}<br />
}<br />
<br />
</syntaxhighlight><br />
|-|<br />
VB=<br />
<syntaxhighlight lang="vbnet" line><br />
<br />
</syntaxhighlight><br />
</tabber><br />
=Explanation=<br />
Attributes ;_;<br />
<br />
FoodUnitsNeeded ;_; The amount of food needed per period, but this current value is just the default and can change based on the formula in the animal class.<br />
<br />
FoodUnitsConsumedThisPeriod ;_; This value is the amount of food eaten this period.<br />
<br />
DefaultLifespan ;_; The average lifespan of the Animal sub class Fox but of course there is some variance.<br />
<br />
DefaultProbabilityDeathOtherCauses ;_; The default chance that the fox will die to causes other than starvation or old age.</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=Thin_Client_/_Thick_Client&diff=1369Thin Client / Thick Client2017-02-06T13:57:13Z<p>Westy-Chan: </p>
<hr />
<div>==Thin Clients==<br />
<br />
A thin client is the term used when a dummy pc is used, a network PC without HDD to act as a terminal. This is because the data processing mostly occurs on the server itself. It is also a term used when most of the software of the network pc you are using is on the server itself rather than the pc.<br />
Thin clients require constant server communication to be keep running the way it should.<br />
<br />
===Advantages and Disadvantages===<br />
<br />
* Easy to deploy requiring no extra or specialised software installations<br />
* Need to validate with the server after data capture<br />
* If the server goes down the collection of the data will go down<br />
* Any workstation can be used on the network to do the same thing<br />
* Reduced security threat<br />
<br />
==Thick Clients==<br />
A thick client is the term used when a network pc that does most of its own processing for on the client itself rather than the server like a thin client. It also refers to the fact software is on the PC itself rather than a server. If the applications you are using require multimedia components or are bandwidth intensive a thick client will be much more effective.<br />
<br />
===Advantages and Disadvantages===<br />
<br />
* Thick clients are much more expensive and require more IT work in the future<br />
* Data verified by client immediately<br />
* Only requires some communication with server<br />
* Reduced server demands<br />
* Increased security issues</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=Thin_Client_/_Thick_Client&diff=1218Thin Client / Thick Client2017-01-03T16:36:56Z<p>Westy-Chan: </p>
<hr />
<div>Thin Clients<br />
<br />
A thin client is the term used when a dummy pc is used, a network PC without HDD to act as a terminal. This is because the data processing mostly occurs on the server itself. It is also a term used when most of the software of the network pc you are using is on the server itself rather than the pc.<br />
Thin clients require constant server communication to be keep running the way it should.<br />
<br />
Thick Clients<br />
a thick client is the term used when a network pc that does most of its own processing for on the client itself rather than the server like a thin client. It also refers to the fact software is on the PC itself rather than a server. If the applications you are using require multimedia components or are bandwidth intensive a thick client will be much more effective.<br />
<br />
Advantages and Disadvantages<br />
<br />
-Thin Clients-<br />
* Easy to deploy requiring no extra or specialised software installations<br />
* Need to validate with the server after data capture<br />
* If the server goes down the collection of the data will go down<br />
* Any workstation can be used on the network to do the same thing<br />
* Reduced security threat<br />
-Thick Clients-<br />
* Thick clients are much more expensive and require more IT work in the future<br />
* Data verified by client immediately<br />
* Only requires some communication with server<br />
* Reduced server demands<br />
* Increased security issues</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=Thin_Client_/_Thick_Client&diff=1217Thin Client / Thick Client2017-01-03T16:36:41Z<p>Westy-Chan: Created page with "Thin Clients A thin client is the term used when a dummy pc is used, a network PC without HDD to act as a terminal. This is because the data processing mostly occurs on the s..."</p>
<hr />
<div>Thin Clients<br />
<br />
A thin client is the term used when a dummy pc is used, a network PC without HDD to act as a terminal. This is because the data processing mostly occurs on the server itself. It is also a term used when most of the software of the network pc you are using is on the server itself rather than the pc.<br />
Thin clients require constant server communication to be keep running the way it should.<br />
<br />
Thick Clients<br />
a thick client is the term used when a network pc that does most of its own processing for on the client itself rather than the server like a thin client. It also refers to the fact software is on the PC itself rather than a server. If the applications you are using require multimedia components or are bandwidth intensive a thick client will be much more effective.<br />
<br />
Advantages and Disadvantages<br />
-Thin Clients-<br />
* Easy to deploy requiring no extra or specialised software installations<br />
* Need to validate with the server after data capture<br />
* If the server goes down the collection of the data will go down<br />
* Any workstation can be used on the network to do the same thing<br />
* Reduced security threat<br />
-Thick Clients-<br />
* Thick clients are much more expensive and require more IT work in the future<br />
* Data verified by client immediately<br />
* Only requires some communication with server<br />
* Reduced server demands<br />
* Increased security issues</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=Section_D_2017&diff=512Section D 20172016-12-15T11:38:40Z<p>Westy-Chan: </p>
<hr />
<div>=Introduction=<br />
You are advised to spend no more than 70 minutes on this section. Questions will use the Skeleton Program and the Preliminary Material.<br />
<br />
This page will identify some of the alterations / improvements that can be made to the skeleton program. It is important to explain what problem the alteration is tackling, and explain how to make the improvement itself.<br />
<br />
=Improvements=<br />
# [[ Add a way for a disease to kill rabbits in warrens]]<br />
# [[Storm or fire affects number of animals in a certain radius]]<br />
# [[Validation for menu options for the coordinate input]]<br />
# [[Display number of rabbits born that period (This can be done if option 2 selected when advancing time period)]]<br />
# [[Constraints for number of animals placed (when option two is selected)]]<br />
# [[Display a message when a cell with no fox is selected for fox inspection...Adding a loop too]]<br />
# [[Foxes have a random chance to move towards the closest warren each time period]]<br />
# [[A fox moves in a random direction if they haven't eaten enough food that turn]]<br />
# [[If a fox eats more food than it needs its reproduction rate/coefficient increases]]<br />
<br />
=Extension of the Skeleton Program=<br />
One question is likely to focus on adding new features and functionality to the program. With the skeleton program and the way it is written this is likely to be to create another prey animal for the fox. This section will document how to achieve this. Other extensions will also be covered over time.</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=User:Westy-Chan&diff=511User:Westy-Chan2016-12-15T11:37:07Z<p>Westy-Chan: </p>
<hr />
<div>[[File:NagisaAnime.jpg]]</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=User:Westy-Chan&diff=510User:Westy-Chan2016-12-15T11:36:38Z<p>Westy-Chan: </p>
<hr />
<div><br />
File:NagisaAnime.jpg|Caption1</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=User:Westy-Chan&diff=509User:Westy-Chan2016-12-15T11:36:24Z<p>Westy-Chan: </p>
<hr />
<div><gallery><br />
File:NagisaAnime.jpg|Caption1<br />
</gallery></div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=Section_D_2017&diff=501Section D 20172016-12-15T11:30:40Z<p>Westy-Chan: </p>
<hr />
<div>=Introduction=<br />
You are advised to spend no more than 70 minutes on this section. Questions will use the Skeleton Program and the Preliminary Material.<br />
<br />
This page will identify some of the alterations / improvements that can be made to the skeleton program. It is important to explain what problem the alteration is tackling, and explain how to make the improvement itself.<br />
<br />
=Improvements=<br />
# [[ Add a way for a disease to kill rabbits in warrens]]<br />
# [[Storm or fire affects number of animals in a certain radius]]<br />
# [[Validation for menu options for the coordinate input]]<br />
# [[Display number of rabbits born that period (This can be done if option 2 selected when advancing time period)]]<br />
# [[Constraints for number of animals placed (when option two is selected)]]<br />
# [[Display a message when a cell with no fox is selected for fox inspection...Adding a loop too]]<br />
# [[Foxes have a random chance to move towards the closest warren each time period]]<br />
# [[A fox moves in a random direction if they haven't eaten enough food that turn]]<br />
# [[If a fox eats more food than it needs its reproduction rate/coefficient increases]]<br />
<br />
=Extension of the Skeleton Program=<br />
One question is likely to focus on adding new features and functionality to the program. With the skeleton program and the way it is written this is likely to be to create another prey animal for the fox. This section will document how to achieve this. Other extensions will also be covered over time.</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=Section_D_2017&diff=486Section D 20172016-12-15T11:21:34Z<p>Westy-Chan: Undo revision 479 by Seun (talk)</p>
<hr />
<div>=Introduction=<br />
You are advised to spend no more than 70 minutes on this section. Questions will use the Skeleton Program and the Preliminary Material.<br />
<br />
This page will identify some of the alterations / improvements that can be made to the skeleton program. It is important to explain what problem the alteration is tackling, and explain how to make the improvement itself.<br />
<br />
=Improvements=<br />
# [[ Add a way for a disease to kill rabbits in warrens]]<br />
# [[Storm or fire affects number of animals in a certain radius]]<br />
# [[Validation for menu options for the coordinate input]]<br />
# [[Display number of rabbits born that period (This can be done if option 2 selected when advancing time period)]]<br />
# [[Constraints for number of animals placed (when option two is selected)]]<br />
# [[Display a message when a cell with no fox is selected for fox inspection...Adding a loop too]]<br />
# [[Foxes have a random chance to move towards the closest warren each time period]]<br />
# [[A fox moves in a random direction if they haven't eaten enough food that turn]]<br />
# [[If a fox eats more food than it needs its reproduction rate/coefficient increases]]<br />
<br />
=Extension of the Skeleton Program=<br />
One question is likely to focus on adding new features and functionality to the program. With the skeleton program and the way it is written this is likely to be to create another prey animal for the fox. This section will document how to achieve this. Other extensions will also be covered over time.</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=Section_D_2017&diff=485Section D 20172016-12-15T11:21:19Z<p>Westy-Chan: Undo revision 481 by Seun (talk)</p>
<hr />
<div>=Introduction=<br />
You are advised to spend no more than 70 minutes on this section. Questions will use the Skeleton Program and the Preliminary Material.<br />
<br />
This page will identify some of the alterations / improvements that can be made to the skeleton program. It is important to explain what problem the alteration is tackling, and explain how to make the improvement itself.<br />
<br />
=Improvements=<br />
# [[ Add a way for a disease to kill rabbits in warrens]]<br />
# [[Storm or fire affects number of animals in a certain radius]]<br />
# [[Validation for menu options for the coordinate input]]<br />
# [[Display number of rabbits born that period (This can be done if option 2 selected when advancing time period)]]<br />
# [[Constraints for number of animals placed (when option two is selected)]]<br />
# [[Display a message when a cell with no fox is selected for fox inspection...Adding a loop too]]<br />
# [[Foxes have a random chance to move towards the closest warren each time period]]<br />
# [[A fox moves in a random direction if they haven't eaten enough food that turn]]<br />
# [[If a fox eats more food than it needs its reproduction rate/coefficient increases]]<br />
<br />
=Extension of the Skeleton Program=<br />
One question is likely to focus on adding new features and functionality to the program. With the skeleton program and the way it is written this is likely to be to create another prey animal for the fox. This section will document how to achieve this. Other extensions will also be covered over time.<br />
[[File:maxresdefault.jpg]]</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=User:Cameron&diff=482User:Cameron2016-12-15T11:20:05Z<p>Westy-Chan: Blanked the page</p>
<hr />
<div></div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=Section_D_2017&diff=478Section D 20172016-12-15T11:17:51Z<p>Westy-Chan: Undo revision 476 by I'mnotthatguy (talk)</p>
<hr />
<div>=Introduction=<br />
You are advised to spend no more than 70 minutes on this section. Questions will use the Skeleton Program and the Preliminary Material.<br />
<br />
This page will identify some of the alterations / improvements that can be made to the skeleton program. It is important to explain what problem the alteration is tackling, and explain how to make the improvement itself.<br />
<br />
=Improvements=<br />
# [[ Add a way for a disease to kill rabbits in warrens]]<br />
# [[Storm or fire affects number of animals in a certain radius]]<br />
# [[Validation for menu options for the coordinate input]]<br />
# [[Display number of rabbits born that period (This can be done if option 2 selected when advancing time period)]]<br />
# [[Constraints for number of animals placed (when option two is selected)]]<br />
# [[Display a message when a cell with no fox is selected for fox inspection...Adding a loop too]]<br />
# [[Foxes have a random chance to move towards the closest warren each time period]]<br />
# [[A fox moves in a random direction if they haven't eaten enough food that turn]]<br />
# [[If a fox eats more food than it needs its reproduction rate/coefficient increases]]<br />
<br />
=Extension of the Skeleton Program=<br />
One question is likely to focus on adding new features and functionality to the program. With the skeleton program and the way it is written this is likely to be to create another prey animal for the fox. This section will document how to achieve this. Other extensions will also be covered over time.</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=Main_Section&diff=473Main Section2016-12-15T11:14:07Z<p>Westy-Chan: Undo revision 472 by Cameron (talk)</p>
<hr />
<div>==The Code==<br />
<tabber><br />
C#=<br />
<syntaxhighlight lang="csharp" line><br />
static void Main(string[] args)<br />
{<br />
Simulation Sim;<br />
int MenuOption;<br />
int LandscapeSize;<br />
int InitialWarrenCount;<br />
int InitialFoxCount;<br />
int Variability;<br />
bool FixedInitialLocations;<br />
do<br />
{<br />
Console.WriteLine("Predator Prey Simulation Main Menu");<br />
Console.WriteLine();<br />
Console.WriteLine("1. Run simulation with default settings");<br />
Console.WriteLine("2. Run simulation with custom settings");<br />
Console.WriteLine("3. Exit");<br />
Console.WriteLine();<br />
Console.Write("Select option: ");<br />
MenuOption = Convert.ToInt32(Console.ReadLine());<br />
if ((MenuOption == 1) || (MenuOption == 2))<br />
{<br />
if (MenuOption == 1)<br />
{<br />
LandscapeSize = 15;<br />
InitialWarrenCount = 5;<br />
InitialFoxCount = 5;<br />
Variability = 0;<br />
FixedInitialLocations = true;<br />
}<br />
else<br />
{<br />
Console.Write("Landscape Size: ");<br />
LandscapeSize = Convert.ToInt32(Console.ReadLine());<br />
Console.Write("Initial number of warrens: ");<br />
InitialWarrenCount = Convert.ToInt32(Console.ReadLine());<br />
Console.Write("Initial number of foxes: ");<br />
InitialFoxCount = Convert.ToInt32(Console.ReadLine());<br />
Console.Write("Randomness variability (percent): ");<br />
Variability = Convert.ToInt32(Console.ReadLine());<br />
FixedInitialLocations = false;<br />
}<br />
Sim = new Simulation(LandscapeSize, InitialWarrenCount, InitialFoxCount, Variability, FixedInitialLocations);<br />
}<br />
} while (MenuOption != 3);<br />
Console.ReadKey();<br />
}<br />
</syntaxhighlight><br />
|-|<br />
VB=<br />
<syntaxhighlight lang="vbnet" line><br />
<br />
</syntaxhighlight><br />
</tabber><br />
<br />
=Explanation=<br />
The main program declares an instance of the Simulation Class. <br />
<br />
<br />
It declares variables for the key information required for the simulation. <br />
<br />
<br />
The option is to start with the predefined values or to enter the values yourself. If option 1 is selected the variables will be assigned their default value, however if 2 is selected the values entered by the use will be assigned to the variables.<br />
<br />
<br />
The instance of the Simulation Class will be assigned the values predefined or entered by the user. This will obviously start the simulation and run the code within that class.</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=Main_Section&diff=470Main Section2016-12-15T11:12:40Z<p>Westy-Chan: Undo revision 467 by Cameron (talk)</p>
<hr />
<div>==The Code==<br />
<tabber><br />
C#=<br />
<syntaxhighlight lang="csharp" line><br />
static void Main(string[] args)<br />
{<br />
Simulation Sim;<br />
int MenuOption;<br />
int LandscapeSize;<br />
int InitialWarrenCount;<br />
int InitialFoxCount;<br />
int Variability;<br />
bool FixedInitialLocations;<br />
do<br />
{<br />
Console.WriteLine("Predator Prey Simulation Main Menu");<br />
Console.WriteLine();<br />
Console.WriteLine("1. Run simulation with default settings");<br />
Console.WriteLine("2. Run simulation with custom settings");<br />
Console.WriteLine("3. Exit");<br />
Console.WriteLine();<br />
Console.Write("Select option: ");<br />
MenuOption = Convert.ToInt32(Console.ReadLine());<br />
if ((MenuOption == 1) || (MenuOption == 2))<br />
{<br />
if (MenuOption == 1)<br />
{<br />
LandscapeSize = 15;<br />
InitialWarrenCount = 5;<br />
InitialFoxCount = 5;<br />
Variability = 0;<br />
FixedInitialLocations = true;<br />
}<br />
else<br />
{<br />
Console.Write("Landscape Size: ");<br />
LandscapeSize = Convert.ToInt32(Console.ReadLine());<br />
Console.Write("Initial number of warrens: ");<br />
InitialWarrenCount = Convert.ToInt32(Console.ReadLine());<br />
Console.Write("Initial number of foxes: ");<br />
InitialFoxCount = Convert.ToInt32(Console.ReadLine());<br />
Console.Write("Randomness variability (percent): ");<br />
Variability = Convert.ToInt32(Console.ReadLine());<br />
FixedInitialLocations = false;<br />
}<br />
Sim = new Simulation(LandscapeSize, InitialWarrenCount, InitialFoxCount, Variability, FixedInitialLocations);<br />
}<br />
} while (MenuOption != 3);<br />
Console.ReadKey();<br />
}<br />
</syntaxhighlight><br />
|-|<br />
VB=<br />
<syntaxhighlight lang="vbnet" line><br />
<br />
</syntaxhighlight><br />
</tabber><br />
<br />
=Explanation=<br />
The main program declares an instance of the Simulation Class. <br />
<br />
<br />
It declares variables for the key information required for the simulation. <br />
<br />
<br />
The option is to start with the predefined values or to enter the values yourself. If option 1 is selected the variables will be assigned their default value, however if 2 is selected the values entered by the use will be assigned to the variables.<br />
<br />
<br />
The instance of the Simulation Class will be assigned the values predefined or entered by the user. This will obviously start the simulation and run the code within that class.</div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=User:Westy-Chan&diff=461User:Westy-Chan2016-12-15T11:07:23Z<p>Westy-Chan: Blanked the page</p>
<hr />
<div></div>Westy-Chanhttps://www.trccompsci.online/mediawiki/index.php?title=User:Westy-Chan&diff=459User:Westy-Chan2016-12-15T11:04:30Z<p>Westy-Chan: Created page with "<gallery> File:Rob.jpg|Caption1 File:Rob.jpg|Caption2 </gallery>"</p>
<hr />
<div><gallery><br />
File:Rob.jpg|Caption1<br />
File:Rob.jpg|Caption2<br />
</gallery></div>Westy-Chan