Rochester Institute of Technology
RIT Scholar Works
Theses
Thesis/Dissertation Collections
1-1-2008
Automated grazing management
Gregory J. Von Pless
Follow this and additional works at:
http://scholarworks.rit.edu/theses
This Thesis is brought to you for free and open access by the Thesis/Dissertation Collections at RIT Scholar Works. It has been accepted for inclusion in Theses by an authorized administrator of RIT Scholar Works. For more information, please [email protected].
Recommended Citation
Automated
Grazing
Management
Master's Thesis
Gregory
J. Von Pless [email protected]Department ofComputer Science
Rochester Institute of
Technology
Signatures
I, Gregory J. Von Pless, do hereby submit this thesis in partial fulfillment of
the requirements for the degree of Master of Science in Computer Science.
It is approved by the committee members below.
Gregory J. Von Pless
Dr. Zack Butler, Ph.D.
Committee Chair
Dr. Leon Reznik, Ph.D.
Reader
Title of
Thesis or Dissertation
Name of Author
Degree Program College Print Reproduction Permission Granted Print Reproduction Permission Denied
Inclusion in RIT Digital Media Library ETD Archive
Thesis/Dissertation
Author Permission Form
Graduate Student Form
0.
beLlS
Rochester Institute of Technology B. Thomas Golisano College of Computing and Information Sciences
Department of Computer Science Building 70, Room 3005
I understand that I must submit a print copy of my thesis or dissertation to the RIT Archives, per current RIT guidelines for the completion of my degree. I hereby grant to the Rochester Institute of Technology and its agents the non-exclusive license to archive and make accessible my thesis or dissertation in whole or in part in all forms of media in perpetuity. I retain all other ownership rights to the copyright of the thesis or dissertation. I also retain the right to use in future works (such as articles or books) all or part of thesis or dissertation.
I,
G ..-
2
0ry
V61"'
P[ ess
,
he.eby.,ant p.,mission
to the
Ro~st'r
Institute of Technology to reproduce my print thesis or dissertation in whole or in part. Any reproduction will not be for commercial use or profit.Signature of
Author~
_ _ _ _ _ _ _ _ _ _ _ _ _Date._5--L~_I_5':,,-VC_o._f{
__
I, , hereby deny permission
to the RIT Library of the Rochester Institute of Technology to reproduce my print thesis or dissertation in whole or in part.
Signature of Author _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Date _ _ _ _ _ _ _ _
G
r~
CJry
V
.. "
P{e6.$
I,
d
~,
additionally grant to theRochester Institute of Technology Digital Media Library (RIT DMU the non-exclusive license to archive and provide electronic access to my thesis or dissertation in whole or in part in all forms of media in perpetuity. I understand that my work, in addition to its bibliographic record and abstract. will be available to the world-wide community of scholars and researchers through the RIT DML. I retain all other ownership rights to the copyright of the thesis or dissertation. I also retain the right to use in future works (such as articles or books) all or part of this thesis or dissertation. I am aware that the Rochester Institute of Technology does not require registration of copyright for Electronic Thesis and Dissertations (ETD). I hereby certify that. if appropriate, I have obtained and attached written permission statements from the owners of each third party copyrighted matter to be included in my thesis or dissertation. I certify that the version I submitted is the same as that approved by my committee.
Acknowledgments
I would like to thank all ofmy
family
members and friends who were sub jected to talkofcattle and grazingmanagement at great lengththroughout thisprocess especial thanksto my parents, andtoChris,
Liz, Tino,
andTay,
who Ibelieve suffered the lion's share in this regard. I'd like to thank Professor Butler for his guidance and continued patience as this process dragged on.ThankstoLinusandSamandtheirgraduate student minionsforputting upwithmymyriad requestsforrunawayprocessestobe killedsomysimula tions couldfinish this century.
Finally,
aspecial thankyoutoTinaSturgis,
who has given me aid and advice on countless occasions, and who helped me convince myselfto get intothis whole Master's degreemess in the firstContents
1 Introduction 1
2 Related Work 4
2.1 Computerized Animal Control 4
2.1.1
Herding
With Robots 42.1.2 Dynamic Virtual Fences 5
2.2
Evolutionary
Algorithms andExpert Systems 62.2.1
Evolutionary
Algorithms 62.2.2 Expert Systems 7
2.2.3
Optimizing
Expert System Parameters 82.2.4
Building
Expert Systems 82.2.5 A Hybrid Hybrid Approach 13
2.2.6 Adaptive Expert Systems 14
3 Algorithm Design 16
3.1
Herding
Algorithm 163.1.1 General Procedure 17
3.1.2 Variables 18
3.1.3 Adaptive Expert System 19
3.2
Evolutionary
Algorithm 223.2.1 Genotype 23
3.2.2 Crossover 23
3.2.3 Mutation 24
3.2.4 Parameters 24
3.2.5 Fitness Calculation 25
3.2.6 Initial Population 27
4 Implementation and Evaluation 28
4.1 Simulator 28
IV
4.1.1 Forces 29
4.1.2 Vegetation Consumption and Growth 32
4.2 Experiments 32
4.2.1 Herd Drift 35
4.2.2 Vegetation
Quality
andElevation 374.2.3 FullSimulation 40
4.2.4 Adaptive Expert System 45
4.2.5 Reduced Thirst
Frequency
484.3 ResultsAnalysis 50
5 Conclusion 53
List
of
Figures
3.1
Grazing
management algorithm 173.2 On-line adaptation algorithm 21
3.3
Defining
membershipfunctions 234.1 Seed system 1 memberships 33
4.2 Seedsystem 2 memberships 34
4.3 Seedsystem4 memberships 35
4.4 Experiment 1 field 36
4.5 Experiment 1 results 37
4.6 Experiment 2 field '. 38
4.7 Experiment 2 control results 38
4.8 Experiment 2 results 39
4.9 Experiment 3 field 41
4.10 Experiment 3 control results 41
4.11 Experiment 3 results 43
4.12 Experiment3 stress-basedfitness Evenness memberships . . 44
4.13 Experiment 3 combinedfitness HAPPINESS memberships ... 45
4.14 Experiment 4 results 46
4.15 Experiment 4 result field2 explained 49
List
of
Tables
3.1 Expert system operators 20
3.2
Evolutionary
algorithm parameters 25Abstract
Management-intensive grazing is a grazing management strategy that re
lies on careful monitoring of animals at pasture and frequent relocation
of animals between various regions of the pasture, or paddocks, in order
tomaximizethe nutrients and sustenancetheanimalsobtainthroughgraz
ing. Whenappliedsuccessfully, thisapproachtograzingmanagementyields higheranimal production, whilecuttingfeed costs;
however,
agreat deal ofoverhead is introduced in monitoring and moving the animals throughout the pasture, making this approach very difficult to implement at a large scale.
Recent successes in the field of dynamic virtual
fencing
have demonstrated the
feasibility
ofautomatically restrainingandmoving cattle within a pasture, and without the need to build or move fences. This technology may be used toreduce the physical overhead of management-intensive
grazing, but it doesnot address the
decision-making
aspects.This thesis proposes a
decision-making
system to be used in conjunctionwith dynamicvirtualfence
technology
toimplement afully-automatedChapter
1
Introduction
Grazing
managementistheprocessthroughwhich animalforaging
behaviorsspecifically, the rates at which various regions of a pasture are grazed are controlled [1]. The goal is to maximize forage production, or the sustenanceand nutrition gainedthrough
foraging,
whichinturncontributes to the maximization of animal production. In order to understand grazing management, one must first understand the players: the animals, and the vegetation.When left to their own devices at pasture, animals exhibit a tendency toward re-grazing certain areas; some causes of this behavior include the presence of
higher-quality
vegetation, proximity to water, or the presence of shade on a hot day.Furthermore,
vegetation that is regrowing afterbeing
grazedismorejuicy,
palatable,andnutritiousthanmaturevegetation, causing animals to prefer re-grazing areas they have previously visited to grazing areas consisting ofmore mature growth.Mature,
undergrazed plants have greater stem mass, makingthem lessdigestible and nutritious. Overgrazed plants do not possess sufficient leaf mass to generate the energy required for regrowththrough photosynthesis;
they
must obtainthisenergy fromtheroot structure, resultingina stoppage ofroot growth [1].CHAPTER 1. INTRODUCTION 2
ofthe trade-off between maximizingthe evenness ofpasture coverage while
minimizingthe stress to cattle.
The most common grazing management strategy worldwide is contin
uous grazing
[2],
wherein the cattle are allowed free access to the entire pasture(i.e.,
cattle stress istotallyminimized atthecost ofcoverage). Con tinuous grazing is simple and requires minimal overhead. It also provides animals access to plant regrowth in the stages ofhighest nutritional value.Continuous grazing generally leads topoor grazingdistribution (due to the aforementionedanimalbehaviors). Placementofdistributionalaids, such as
artificialfeedand watersources, canoften
help
tominimizethisproblem[3]
. An alternative to continuous grazing is management intensive grazing:a strategy that has been studied and used for at least 25 years, and that is generally considered
theoretically
sound, but is rarely implemented in its strictestform becauseitoften conflicts withpractices already inplace. This grazing management strategy relies on the subdivision ofthe pasture into paddocksthrough the deploymentofpermanent andtemporary
fencing
[4]
. Permanent fencesare usedtodividetheprimary paddocks;temporary
fencesare used to prevent access to an overgrazed section of the paddock, or to force spot grazing of a previously undergrazed area. The grazing manager
has at his disposal the selection of active paddocks or subregions and the stocking rate in each paddock or subregion as tools for
implementing
in tensivegrazing. Management intensive grazingrequiressignificantlygreater overhead, in the form of fencebuilding
and maintenance costs and laborcosts, as compared to continuous grazing; inthe case ofbeefcattle, it has
been showntoyield an increase inpounds ofbeefproduced per acre of over
533% oftypical continuous grazingyields
[4]
.Management intensive grazing requires moving animals between pad
docks approximately once every three
days;
these paddocks should not be larger in sizethan 5 acres, with stocking rates ofapproximately 10 animalsper paddock [5]. The time and labor commitment required to meet these requirements aresubstantialinthecontext ofasmallfarmor ranch (in
fact,
many farmers tend to bend these guidelines in practice). In the context of an extremely large ranch, they appear to greatly outweigh the benefits in increased animal production. The
King
Ranch in Texas is agood example:it consists ofapproximately 825,000 acres (compare to RhodeIsland's size of approximately 776,957 acres) and about 60,000 head of cattle [6]. In a strict application of intensive grazing, these cattle would be split among
in-CHAPTER 1. INTRODUCTION
tensive grazing would require the
building
and maintenance ofagreat deal ofadditionalfencing. TheKing
Ranch currentlycontainsanestimated2,000miles offence.
Depending
on the estimator used, the annual maintenance costofthesefencesrangesfrom$422,400[7] (assuming
theleast costlyfencetype)
to$6.6 million[8].However,
ifmanagementintensive grazingcouldbeimplemented with significantly less overhead, it would mostly
likely
proveprofitable at all scales.
Previous work has shown that virtual fences effectively prevent cattle
leaving
a virtualpaddock, and can beusedto movethemfrom onelocation to another[9], [10],
[11]
(see Section 2.1.2). Virtualfencing
presents thepotential for large-scale reductionin
fencing
andlaborcosts, asthegrazing managerwould need onlyto choosethepaddock, orpaddocks, he wishestobe active, and allowthe automated system movethe cattle there and
keep
theminplace. Fromthispoint, thenextlogicalstep istoautomatethegrazing
managementdecision-making,
ashuman management, even with virtualfences,
would still require managing up tohundreds,
or even thousands, of small paddocks.This work presents a preliminary approachto automating the intensive
grazing management process; to the author's
knowledge,
no other algorith mic solution to this problem has been published. The solution presented here relies onthe use of an expert system to modelthedecision-making
of the grazing manager: it determines when, and to where, the cattle should be moved;however,
rather than determine the appropriate rules in the traditional manner(by
consulting a domain expert), rules are learned viaan evolutionary algorithm.
Grazing
management decisions are often verysituation-specific,so it would bedifficult togleangenerality from adomain expert, whereasanevolutionary algorithm will be asgeneral, orspecific, as its fitness function allows. The procedure for evolving expert systems used inthisworkismodified fromandinspired
by
a number ofpre-existingmethChapter
2
Related
Work
2.1
Computerized Animal Control
Multiple approaches to automated animal containment and motion induc tion have proven promising or successful. These approaches provide the foundation for artificially intelligent grazing management: the ability to move animals fromone location to another automatically.
2.1.1
Herding
With RobotsVaughanet al. have been experimentingwith arobotic sheepdog for quite
some time
[12],
[13]. Their technique exploits the predictability offlocking
behavior in the animals to be herded in a relatively simple feedbackloop
algorithm. The robot always maneuvers such that the herd centroid will be located between it and agoal
location,
with the understanding that the herd will flee from the robot toward the goal. This work was shown to befairly
successful in controlled real-world experimentsinvolving
ducks.The robot sheepdog accomplishes successfully the task set to an actual
CHAPTER 2. RELATED WORK
2.1.2 Dynamic Virtual Fences
In virtual
fencing,
a virtual paddock is defined using a positioning system,such as GPS. Animals are confined within the virtual paddock not
by
a physicalbarrier,
but rather through theapplication of stimuli design todiscouragethem from
leaving [9], [10],
[11]. Commonstimuli include auditoryhints
(threatening
predatornoises, orthe variouswhoops and calls usedby
cattlemen when moving cattle, for example) or electric shocks. Some sys
temsuse a combination ofstimuli, providingan auditory warningbeforethe virtualfenceis reached, followed
by
electric shocks ofincreasing
severityas thecow crosses thefence. Results have been better with the use ofelectricshocks, as cattle become aware that the auditory signals are not actually coming from predators or cattlemen.
Dynamic virtual fences are virtualfences that move over time
(i.e.,
the locationat whichthefencestimuliare appliedischanged). Currentprogressin dynamic virtual fences includes successfully restricting cattle movement
withinthevirtualpaddock,movingcattle
by
slowly movingthevirtual paddock,
andinter-pose,
path-, and fence-planning. Butler et al. successfully influenced the motion of a herd in simulation, and obtained encouragingresults with realcattle
[9]
.They
usedanexclusively auditorystimulus com posed of a
library
of predator sounds, which were chosen at random. This approach wasinitially
successful, but suffered from habituation.Anderson et al. used a hybrid audio/electric shock system that did not suffer from habituation [10]. In their experiment, 2 cows were confined with avirtual paddock bounded on three sides
by
virtualfences,
andby
a conventional barbed-wire fence on the fourth. The north and south virtual fencesmovedin tandem at a speed ofl.lm/hr for 10 hourseachday. Over the courseofthe nine-daytrial, neither cowsuccessfullyescapedthevirtual paddock.Butler et al. added further automation to their virtual fences through
an algorithmforplanningthe corridor betweentwo desiredvirtualpaddock poses [14]. Thisalgorithm uses anA* searchtogenerate abaselinecorridor, whichisthenmodifiedtoavoid obstacles whennecessary,ortoenclosethem if
they
are small enough. Cattle are guidedthrough the corridorby
a seriesCHAPTER2. RELATED WORK 6
2.2
Evolutionary
Algorithms
andExpert
Systems
A large
body
of prior work exists in the fieldsof both evolutionary expert systems and adaptive expert systems.Many
methods of evolving expert systems have beendeveloped,
operating with various levels of complexity. Anumberofthesemethods arediscussedhere;
theirdrawbacksarediscussed in Chapter 3.2.2.1
Evolutionary
AlgorithmsAn evolutionary algorithm attempts to simulatethe biological processes of adaptation, mutation, and natural selectionto evolve a solution to a prob lem. Thealgorithm consists of a population of
individuals,
witheachindivid ual representinga solution. Individuals are evaluatedby
afitnessfunction,
and then the fittest individuals are chosen to create the next generation. This process isrepeated until the population converges.The evolutionary algorithm consists ofthe
following
components:Genotype The genotypeis therepresentation ofthesolution on whichthe genetic operators act. This is generally an arrayor tree.
Crossover Operator Crossover istheact ofcombiningtwoor more parent individualstoproduce thesame number of newindividuals. Themost common crossover operator is 1-point crossover, whichis most easily understood in the context of an array-based genotype. A cut point n is chosen; thefirst child's array contains the first n values ofthe first parent'sarray, and thevalues
following
the firstn values ofthesecond parent's array; thesecond child's array is composed ofthe remaining values.Mutation Operator Mutation is the act ofrandomly altering some part of an individual'sgenotype. Thetwomost commonformsare replace ment
(e.g.,
replacing a random value in arraywith a newvalue), and swapping(e.g.,
swapping two randomly selected arrayvalues).CHAPTER2. RELATED WORK 7
randomlywith aprobabilityproportionalto theirfitness. Fitness pro
portionalmethods are preferred because
they
occasionallyselect unfitindividuals,
whose genetic material should remainintheglobalgeneticpooltoprevent earlyconvergence.
2.2.2 Expert Systems
Here is presented a very brief review of rule-based expert systems. In a
rule-basedexpert system, aset of rulesis used, along withthecurrent envi
ronment state, toperform
inferencing
and generate an output or a decision.Generally,
each rule is ofthe form: ifx, then y; in a ruleofthisform,
x isreferred to as the antecedent, and y as the consequent. The results of each ruleare aggregatedin some mannerto produce asingle output, or multiple outputs or actions may begenerated.
Fuzzy
expert systems make use offuzzy
sets in order to express rules at a higher level. Afuzzy
set is a set whose elements are members ofit tocertaindegrees. This may be formalized
by
stating that the membershipofavariable xin a
fuzzy
set A is:Ma
(x)
=f(x),
where
/
isa function returninga value in the range[0,
1].Rules in a
fuzzy
expert system are generallyof the form: if x is in A, then y is in B, where A and B arefuzzy
sets with pre-defined membershipfunctions. The degree to which y is in B is
determined,
through a processknown as
denazification,
using the degree to which x is in A. In additionto generating the set of rules, the developer must also specify the
fuzzy
membership functions. The advantage ofthis approach over simple expert
systems is that the rules read more like a person's reasoning. For
instance,
consider thefollowing
two rules:1. If it is cold, thenI should dress warmly.
2. If it is less than
40F,
thenI should cover 90% ofmy body.Rule #1 is fuzzy: the words "cold" and
"warmly"
do not have a specific
meaning;
however,
forthepurposes ofunderstanding why theagentutilizingCHAPTER 2. RELATED WORK
2.2.3
Optimizing
Expert System ParametersPerneelet al. propose a manner for performingexpert systemoptimization on atiered system [15]. In theirexpert systems, the rules are grouped into anumberof
levels,
with the rules in eachlevelbeing
related.Furthermore,
each rule, and eachlevel,
is assigned a weight, which affects that rule's orlevel'seffect ontheoveralldecision-making. Optimization isperformedover the overall weighting of the
levels,
the weighting of the rules within thelevels,
and the parametersdefining
thefuzzy
membership functions. Thechromosome,
0,
is definedas0 =
(Pi,
...,Pn,Wn,
...^nMn^Hn,,HnMn)
where /% represents the weight associated with the ith
level,
uiij represents theweight of rulej
underleveli,
0#i;
isa vectorcontainingthemembershipfunctionparametersforrule
j
underlevel i, nisthenumber oflevels,
andMj
is thenumber of rules underlevel i.Basically,
thegeneticalgorithmisgiven control over the influenceof each rule, the influenceof each group of rules, andthe shapeofthefuzzy
membership functions.Thus,
given animperfect expert system generatedby
ahuman,
thegenetic algorithmfine-tunes it to better solve thegiven problem.An important component ofPerneel's and his colleague's genetic algo rithm is the calculation offitness: how does one determine if a given rule weighting is good? In this case, a
learning
database is used. Thelearning
databaseconsistsofa setofdecisionproblems paired withdesired decisions. Eachexpert system's fitnessis measured as a sum of absolute errorbetween the system's output andthe desired output foreach databaseproblem.Perneeletal. have appliedtheiralgorithmtoan object recognition prob lem: classifyingtargets given two-dimensional infrared images. The expert system must first determinethe orientation ofthevehicleinthe
image,
and then makethe classification.A basis forresultscomparison was obtained
by building
an expert systemmanually to solve the problem. After optimization, the new expert system outperformedthe manual system in 40.5% of cases. In 55.0% ofcases, the optimized system performed
identically
to the original,andin4.5%ofcases, theoptimized system performed worse.2.2.4
Building
Expert SystemsCHAPTER 2. RELATED WORK
give thegenetic algorithm more power. This can mean allowing it to build
therule set
itself,
tochoose the membershipfunctions along with their pa rameters, or both. Although thegenetic algorithm's increased control may allow it to find even better solutions, there is an explosion in termsof thesize ofthesearch space whenthefullcontentsofthe rulesandmemberships are part of the chromosome.
Any
approach to evolving an expert system must imposesomelimitationsonthesearchspace, or convergencemaynever occur.Evolving
New RulesDrabarek et al. overcome the complexity of evolving a full
fuzzy
expert systemby
eliminatingthe fuzziness [16]. Stated moreformally,
they
utilizethreshold membership functions:
, ,
fo
if:c<0 /xA{x)
= <,
I 1 otherwise
where 9 is the threshold constant.
Furthermore,
the thresholds used are definedapriori, and arenot evolved.Thus,
thegenetic algorithm must only searchthe space of possiblerules; still a vast space, but tractable.The goalin Drabarek's and his
colleagues'
work wasto evolvenew rules for an expert system capable ofperformingdiagnostics on a radartransmit
ter. Theirchromosomeconsistsoftwologicalparts: therule antecedent (the "if"
clause), and the rule consequent (the "then" clause). Each antecedent is a vector of integers in the range
[1,1],
where each integer representsone of 10 important symptoms (these are the connections between circuit components). A value of1 indicates that thesymptom shouldbe normal, a value of0 indicates that the symptomis not considered, and a value of 1
indicatesthat thesymptom shouldbeabnormal. Each consequent is a vec
tor ofintegers in the range
[0, 1]
, where each integerrepresents a symptomor circuit component that should be checked. A value of 1 indicates that
the component or symptom should be checked, and a value of0 indicates
that it should not bechecked. Thewhole chromosomeis theconcatenation ofthe antecedent part and the consequent part.
Asin thework ofPerneelet al., the calculationoffitness is both impor
tant and non-trivial. Rather than providing training
data,
Drabareket al.use a set ofheuristics to determine ifa given rule is acceptable. Rules are
judged
by
thefollowing
criteria1:CHAPTER 2. RELATED WORK 10
1. A path from each incorrect antecedent symptom to each consequent
component should exist inthe circuit. Shorter paths are better.
2. A backward path from each consequent object to each correct an
tecedent symptom should existin the circuit.
3. Rules in which checking a consequent component is recommended,
despite all symptoms
leaving
that componentbeing
correct, are penalized.
Theseheuristicsreward rulesthat appropriatelyrelate symptoms and com
ponents, and that do not recommend checking clearly operational compo
nents, which is wasteful.
Testing
experiments were run, in which the system was provided with information about two symptoms connected to a single component (one isan
input,
the other is the output). The component has two other inputs. After running the genetic algorithm, rulesindicating
that the componentshould becheckedif anycombination ofitsinput symptoms are correct and its output symptom is incorrect were evolved. The number of generations
required to obtain these rules, and the completeness ofthe generated rule
set, were both
decreasing
functions ofpopulation size. The system may beconsidered a success, as it generated logical diagnostic rules;
however,
theproblem of rule generation was appliedtoa problem wherethe
full,
optimal rule set couldeasily begeneratedmanually(and,
infact,
theauthors providethis ruleset).
Separate Evolution ofRules and
Membership
FunctionsThe previous section's result indicates that rules can be evolved, but with
out considering membership functions. In this section, two approaches to
evolving both rules and memberships are discussed. As previously stated,
theproblem of an explosioninsearch spacecomplexityarises. Bothmethods
presented here account forthis issue
by
evolving the rules and membership functions separately, admitting an additive increase in complexity, ratherthan a multiplicativeone.
Amaral et al. use a serial approach:
first,
rules areevolved; then, mem berships are evolved [17]. When evolving the rulebase,
the chromosomeCHAPTER 2. RELATED WORK 11
in
fuzzy
logic). All possible rules are dealt with in each chromosome because the solution is
being
applied in evolutionary hardware.Thus,
each ruleactuallyrepresents a possibleinputto someconfigurablehardware,
andthe consequents are the hardware's outputs. Fitness for the first round is determined using "traditional
metrics"
(mean squared error or root mean
squarederror);
however,
thepaperdoes notdiscuss howexpectedvaluesaredetermined: the process is most
likely
application-specific.Once the rules havebeen evolved, a separategenetic algorithm is used
to optimize the
fuzzy
membership functions. In this step, the chromosomeconsists of a vector of values
identifying
thevertexes oftriangularmembership functions (3 vertexes per
function)
. Once again, the details of fitnessevaluation are rather vague.
Amaral et al. tested their methodology
by
applying it to a simulatedevolutionaryhardwareproblem. Twoexperiments wereconducted, wherein
the evolutionary
fuzzy
system was asked to model two systems. For comparison, the experiments were also performed on a neural-fuzzy system, called
NEFCON,
and a neural-genetic-fuzzy system, called NEFCON-GA.NEFCON-GA had the best performance; the authors point out,
however,
that the NEFCON-GA produced rather irregular
fuzzy
membership func tions, which make the system more difficult for a human to interpret. Theevolutionary
fuzzy
system's more interpretable memberships demonstrate the trade-offbetweenperformance and interpret-ability.An alternative to serial evolution of rules and memberships is parallel
evolution (co-evolution). Akbarzadeh-Tet al. propose a
co-evolutionary ap
proach toevolving
fuzzy
systems, wherein the rules areevolved via geneticprogramming, andthemembershipsare evolved
by
agenetic algorithm [18].Here,
search space complexity is lessened through the use of abinding
matrix, which determines which rule sets combine with which membership
function sets (not all combinations are tried).
Furthermore,
the conceptof "friendship" is introduced: when a specific rule set/membership set pair
performs particularly well, itsbond is weighted.
ThemainfocusofAkbarzadeh-T 'sandhis
colleagues'
paperis computing
the fitness ofcombined individuals. Each rule set's fitness is calculated as
theweightedaverage ofitsperformance when coupled with eachmembership
function,
where the weights are determinedby
the level offriendship
thatexists between each rule set
/membership
set pair. The performances are also used to determine modifications to thesefriendship
levels. The fitness for eachmembershipset is computedin a similar manner.The co-evolution method was tested
by
using it to evolve an expertCHAPTER2. RELATED WORK 12
expert system isgiventhelast fourvalues ofthe series andmust outputthe nextvalue. The proposedmethod was
largely
successful, and outperformed both a static expert system and an expert system consisting of uniformmembership functions and rules evolved usinggenetic programming.
Evolving
Rules andMembership
Functions TogetherCalvoet al. developed a systemfor obstacleavoidance thatuses aconstruc tive neural network with a
fuzzy
system component [19]. A genetic algorithm builds a
fuzzy
system to determine when neurons should be added to the network (there is a trade-offbetween increased performance and increasedcomplexitywhenaddinganeuron);performanceofthe
fuzzy
systemis based on the number of nodes it adds to the neural network
during
anobstacle avoidance task. In this genetic algorithm, rules and memberships
are evolved at the same time, in the same individual. The search space is limited
by
thefact that there areonly four inputs to thefuzzy
system, andonly threepossible memberships for each inputto each rule.
The
fuzzy
systembeing
evolved is not an expert system, but rather it is a classifier system. In this type ofsystem, only one ruleis executed: theone withitsantecedentpart mostclosely matchingtheinput. Inthespecific application explored
by
Calvoet al., the winningrule's consequent value isthenusedtodeterminewhetheranew neuron shouldbeaddedto theneural
network.
Each individual represents a set of rules and membership function pa
rameters; a single rule is encoded as:
Wo,
VUV2, V3,
A0, A0, A0, A1,A1,A1,A2, A2, A2,
A3, A3, A3,C],
where each
Vi
indicatesthesettowhichinput i shouldbelong
(0 LOW, 1 = MED,and 2=HIGH),the
A{
values determinetheshapes ofthe membershipfunctionsforthe
fuzzy
variables, andCistherule consequent. Reproductionconsistsof one-point crossover and mutation.
Calvoetal. present an
interesting
approachtocreatingnew generations.Anewgenerationis not created untiltheperformanceoftheneural network
decreases. Performance is determined
by
thenumber of collisionsthatoccurwhileattempting to navigate to atarget. Ifperformance is not
decreasing,
then the classifier system is properly adjusting the neural network, and soshould not be modified.
Theproposedsystem wastestedinmultiple simulated environmentsand
CHAPTER 2. RELATED WORK 13
to build a neural network with halfas many nodes that could successfully
collect targets andavoid obstacles nearly all ofthe time.
The approachtoevolvingexpert systemsdeveloped for thisworklies in
betweenthosediscussedinthelasttwo sections: therules andmemberships
are evolved via asingle evolutionary algorithm;
however,
thecrossover and mutation operators alwayshandle rules andmemberships separately.2.2.5 A Hybrid Hybrid Approach
In this section, an approach fromShi et al. is presentedthat combinesideas
from the previousoneand from Xu and Vukovich [20]: evolvingthe fullex
pert system, bothrules and
fuzzy
memberships, andusinganexpert systemto optimize the genetic algorithm parameters [21]. The only search space
limitation imposed inthissystem comesfromthefixedrulecomplexity(this has beenafeature commontomost ofthesystems presented: rules perform
only a simple combination ofthe
inputs)
.In the work ofShi et al., the chromosome is represented as a string of
integers. These integersencodethenumber of rulesinthe system, the
fuzzy
membership function types (there are six) and parameters for eachinput,
and the rules. A maximum number of allowed rules is calculated a priori, and each chromosome encodes this many rules; the rule count encoded atthe
beginning
ofthechromosome indicates how manyofthe encoded rules are actuallyused; the rest areignored,
but are still encoded in order that the chromosomes all be of uniform length.The rules encoded within a chromosome are not necessarily valid, so
a form of genetic repair must be performed. In this work, invalid rules are simply removed from the system when it is built from the chromosome
data. Invalidrulesaredefinedasthosecontainingeither no antecedent or no
consequent part. Ifall rules are removedfrom anindividualinthis manner,
it is assigned an arbitrarylowfitness.
Fitness is computed using
training
data. An application-appropriate error metric must be determined. In the case of function estimation, the authors recommend a relative errorfunction,
so that themagnitude ofthe targetoutputdoesnot affecttheerror calculation. Forclassificationsystems,the authors recommend a comparison of correct classifications to incorrect
ones.
Shiet al.usean adaptive genetic algorithmtodecreaseconvergencetime.
The genetic algorithm's adaptation is accomplishedthrough a static expert
system, whichis designed tomitigate the trade-offbetween performingmu
CHAPTER 2. RELATED WORK 14
adaptationis toencourage crossover
during
the early generations, when fitness is
low,
and to encourage mutationduring
the later generations, when fitness is high. The motivation behind this is that mutation can tweak analreadyfit
individual,
while crossoveris bestforquickly changinglargepartsof anindividual. Thus crossingfitindividuals hasagoodchance of
destroy
ing
what makesthemfit,
whilemutatingunfit individuals willchange them little over manygenerations.The systemhas been applied to a classification problem: classifying iris
specimens
by
species. The authors ran a number of simulations,testing
with variousrestrictionsontheirsystem
(fixing
the memberships, turningoffgenetic algorithmparameter adaption, andboth). The systemthat evolved
bothrules and memberships, and used the adaptive genetic algorithm, had
the best overall performance both in correctness of classification and in
convergencetime.
2.2.6 Adaptive Expert Systems
Themethodsdescribedintheprevioussections allmodifytheexpert system
throughindirect
learning,
i.e.,
learning
is ultimately accomplished throughrandom modifications that eventually lead to a better result. This section
presents two methods for performing
learning,
or other modifications, in adirect manner: adaptive-network-based
fuzzy
inference systems(ANFIS),
which use backpropagation
learning
to arrive at optimal rules, and metarules, which are rules built into the expert system itself that operate on
other rules, ratherthan onthe expert system output.
Adaptive-Network-Based
Fuzzy
Inference SystemsANFIS is a methodology proposed
by Jang
[22]
that combinesfuzzy
inference systems (expert systems) and artificial neural networks, in order
that the inference system rules and memberships may be learned from in
put/output
training
pairs. Althoughit isprimarilyan off-line methodology,the ANFIS may be retrained at regular intervals to allow it to adapt to
newinformation. The ANFIS performsdirect
learning
in the sensethat itslearning
mechanismdeliberately
reducesthe difference between thedesired and actual outputs.Thus,
the system's desired output must be known foreachinput vector;
however,
as ismade more clearin Chapter3,
theoutputof the proposed expert system is not
known,
and its validity can only be determinedindirectly.Therefore,
direct modificationmust be accomplishedCHAPTER 2. RELATED WORK 15
Meta-Rules
Meta-rules provide a mechanism for altering (either permanently or tem porarily) anexpert systemin an on-line manner basedupon current
input,
or other stored or gathered information. Meta-rules are often used to re
strict the number ofrules that actually fire for any given
input,
usually to increase the efficiency of the inference engine [23,24].They
can also be used to add rules to, modify rulesin,
and delete rules from the system.Jankowska
[25]
discusses the use of meta-rules fordetecting
and resolving contradictions betweenrules, a problemthatcanarisewhen rules are addedChapter
3
Algorithm
Design
The automated grazing management solution presented in this chapter is
comprised oftwo major parts: the management algorithm, which actually
performs grazing management, employing an adaptive expert system for
decision-making,
andthe evolutionaryalgorithm, which isused tolearn thebest expert system given some fitness metric.
The evolutionary algorithm and on-line expert system adaptation algo rithmcomplement one another
by
performingglobal and locallearning
andadjustment, respectively. The evolutionary algorithm operates on a met
ric supplied at the end of testing, representing the overall performance of
the system; the on-line adaptation algorithm operates throughout testing,
making adjustments to the system based on observed cause-effect relation
ships while it runs.
Furthermore,
because the procedure through whichthe evolutionary algorithmlearns is ultimatelyrandom, whereas theon-line
adaptation is based on reasoning, together the two algorithms account for
twoformsof solution modificationoccurring
during
humanproblem-solving:identifying
that the current solution is inadequate andexperimenting withpossible changes tosee if it can be improved
(evolutionary
algorithm), anddeducing logically
correctionstobemadeto thecurrentsolutionbasedupon observations ofits effectiveness (adaptation algorithm).3.1
Herding
Algorithm
A
herding
algorithmusingan expert systemtoperformdecisionmakinghas been developed. Thealgorithmadaptsitself inanon-line mannerby drawing
conclusionsfromobserved cause-effect relationships, inorderthat a general
expert systemmay be applied to more than one specific
herding
situation.CHAPTER 3. ALGORITHM DESIGN 17
Manage-Grazing
1 while true
2 dofor each cell
Q
G{Ccurrent
UNEIGHBORS(Ccurrent)}
3 do
R[i]
<-Score(Q)
4 Goto
(Cargm^i{m})
5
WAIT(t)
Figure 3.1: High-level grazingmanagement procedure, t is the time towait between iterations.
Herd behavior shares a good deal of commonality;
however,
differences inclimate, timeof
day,
and cattlebreed,
amongothers, canaffecttheobservedherd behavior. On-lineadaptation allows a general algorithmtobedeployed
inthesevarious situations andtweakitselfbasedupon runtime observations.
3.1.1 General Procedure
The procedure described in this section is inspired
by
the indirect cover age algorithm describedby
Pirzadeh and Snyder [26]. In indirect coverage,the environment is split into a grid. The number of visits to each cell is
stored; when
deciding
whichcell tovisit fromthe current one, thecell withthe fewest total visits is chosen.
Eventually,
the whole environment will be visited at least once. Theherding
algorithm splits the field into a grid oflarge cells (each cell should be large enough to allowthe cattleto graze for
awhile before they must be forced to move; management-intensive grazing
dictates 1-5 acres per paddock), andkeeps the cattle within one cell using four virtual fences deployed along the edges of the current cell, each hav
ing
infinite length. At a well-definedinterval,
an expert system is used tocalculate a score for the current cell and each cell within the current one's
4-neighborhood. Ifthe current cell's score is
highest,
then nothing isdone;
otherwise, the cattle are moved slowly to the cell with the highest score.
Thisprocess is repeated
indefinitely,
and is definedformally
inFigure 3.1.The GOTO function is quite simple. Since all virtual fences are infinite in
length,
and since movement is always in a cardinaldirection,
only two fences have to be moved. Thefence adjoining the new cell isimmediately
moved to the far end ofthat cell, so that the cattle may begin moving intoCHAPTER 3. ALGORITHMDESIGN 18
speedisslowenoughthatif anycattleareshocked
by
themovingfence,
theywill be ableto move away from it quicklyenoughtoavoid
being
repeatedlyshocked. The
herding
algorithm is paused until movingto the new cellhascompleted.
SCORE
(Cj)
iscalculated using an adaptive expert system obtainedfroman evolutionary algorithm. Each rule in the expert system is ofthe form: "if expression, then y,"
where y is a real value. Let R* define the set of
all rules, andthe function y
(R),
for someRR*,
denotethe output valueobtainedfrommultiplyingthe yvaluein R'sconsequent
by
theoverallfuzzy
valueofi?'santecedent.
Then,
the totalscoreforthecellCi
is SCORE(Cj)
=J^ReR*y(R)-
Additionally,
thecurrentcell's scoreincludesa constantbonusrepresenting the inherent reduction in cattle stress obtained through not
movingthem.
3.1.2 Variables
Thissectiondescribesthevariables availabletotheadaptive expert system.
The
following
variables are cell-specific:Vegetation The mean vegetation value forthe cell.
Water The percentage ofthe cell consistingof water.
Obstacles The percentage ofthe cellthat is impassable.
EVENNESS The difference inelevationbetweenthehighestandlowestpoints
in thecell, expressed as a percentage ofthemaximum possible differ
ence.
HAPPINESS Perceived happiness levelofthe cattlein the cell; this is calcu
lated as 1 min
(
1,
^)
, where z is the number of shocks recordedy ZmaxJ
in thecell forthegiven time period, andzmax is the number of shocks
per time period considered to represent massive stress levels among
the cattle (the value used is 1 shock per second).
Cell-AGE Avalue
representing both how
long
thiscellhas beenthecurrentcell, and how
long
it has been sincethis cell wasthe currentcell.The
following
variablesare equivalent acrossall cells:LINEARITY Avaluerepresentinghowlinearthepathtaken
by
thealgorithmhas
been;
this is calculated as the ratio ofthe number of cells alongone axis that have been visited since the last axis changeto the total
CHAPTER 3. ALGORITHM DESIGN 19
Herd-Displacement Theratio ofthedistancetheherdwasdisplaced dur
ing
this time interval to the maximum displacement possible withinthe cell and time interval. A very small herd displacement indicates
that the cattle are
bunching
at afence thatthey
wish to cross; conversely, avery high displacement indicates that the cattle are moving farther or fasterthan theynormallywould to find food or water.
TheHappiness and Cell-Agevariablesforeach cell are modified over
time. Cell-Ageis decremented
by
a constant valueforthecurrentcell andincremented
by
a constant value for all other cells (it is capped within therange [0,1]). The decrement for Cell-Age is larger than the increment.
Happiness is set forthe current cell usingthe aforementioned calculation.
For each cell, Happiness is incremented
by
a constant value (once again,it must remain within the range [0,1]). These increments and decrements
occur each time the overall algorithm loops.
3.1.3 Adaptive Expert System
The adaptive expert system consists ofthree parts: the rule set, the
fuzzy
membership
functions,
andthreshold value 9. The rules are usedto calculate a score for acell, as described above.
Fuzzy
membership functions areusedtodeterminetheextent towhichthecell's rawdata
belong
to thevari ables described inthe previous section. The 9value is used in the adaptive algorithm.Rules
The expert system's rules are all ofthe form "if expression then y,"
where
y is the amount to add (or subtract) from the total score when expression evaluates to 1. The expression is a
fuzzy
expression composed of operatorsand operands. Operands take the form of a
fuzzy
membership query for a specific variable. Table 3.1 describes thepossible operators.Membership
FunctionsThreetrapezoidal membership functions are stored for eachvariable, defin
ing
thatvariable'sfuzzy
membershipinthesetsLOW, MED, andHI. Theonlylimitations imposed uponthe definitionofthesefunctionsarethat the LOW
CHAPTER3. ALGORITHMDESIGN 20
Operator Syntax Evaluation
and exprl and expr2 min(exprl, expr2)
or exprl or expr2 max(exprl, expr2)
not not expr 1 expr
current-cell current-cell 1 ifthecell
being
processedisthecurrentcell, 0otherwise.
reachable reachable 1 if the cell
being
processed isdirectly
reachable from the current cell, 0other
[image:30.517.80.437.107.234.2]wise.
Table 3.1: Operators found inexpert system rules.
On-line Adaptation
The adaptive algorithm maintains adirected graph associating the current
cell's environment with the current perceivedhappiness ofthe cattle; thus,
this graph provides arudimentary representation of cause and effect. The
current cell state at time t is represented
by
the vectorStc
=[V,0,W,A,E]
where
V,
O,
W,
A,
and E are integersdenoting
thefuzzy
set (low =0,
med=
1,
hi=2)
towhichthevariablesVegetation,
Obstacles,
Water,
Cell-Age,
andEvenness,
respectively, most belong.Likewise,
SlH
is theset to which Happiness most belongs. The
following
multi-sets hold thecumulative state:
sh
=\Jstc,s*H
=\JstH
t t
Theadaptivegraph
Gs^->s*H
is aweighted, directedgraph mappingcellstatesto perceived happiness with weights
indicating
the number of occurrences of a specific mapping.
Thus,
v(Gsh^s*H)zZS*cUS*H
E
(Gsh^s*H)
=|
(,
v,w)\u=S_
,v = StH,w=-(,)
(
|J
(Sfj, &)
J
1
wherethefunctionna
(B)
=thenumber of occurrences of a in multi-set B.The algorithm to populate
Gs,-*s^,
determine whenlearning
takesCHAPTER 3. ALGORITHM DESIGN 21
Adapt
1 Obtain
S&
andSH
2 if
(Sc,
SH,
w) GE(gs*c^s*h)
for some w3 then w <u;
+ 1
4 else
(GS.
^-)
- E(gs^s-h)
U{
(5*,,
5^,
l)
}
5(5c,
Sh,
w) <max, , _/_ \
1^}
6 if w > 9
7 then for each rule Rin theexpert system
8 do V<
the set of variables referencedin R
9 dHl^-Sell
10 if
SH
= 2l,e 4 J.
12 if
SH
= 0f 4-Jjy"I
13 then
Ay
< dmax<l,e * >14
Ry^Ry
+Ay
15
(G-S-s&)
<~^(G^-s^)
[image:31.517.83.407.124.382.2]-{(Sc,
SH,w)}
Figure 3.2: Pseudocodedescribingtheexpert system adaptation algorithm.
ofsignificance (the system's 9 value is the threshold for
determining
significance;
see lines1-6)
, and then modifies the consequent values ofthe rulesbased upon their relevance to the cause-effect relationship
identified,
andwhether the effect (perceivedcattle
happiness)
is positive or negative (lines8-15). Therelevance of a ruleto a cause-effect relationshipis measured
by
determining
the similarity between the cause (environment state) and thestate the rule attemptsto match.
In the pseudocode,
Ry
is used to represent the consequent value oftherule R. The variable set,
V,
for ruleR is composed ofordered pairs(v,
s),where v is one ofthe system variables, ands is one ofthe three
fuzzy
sets.For each operandin R ofthe formpa{v),
J(Jze{o,i,2}-s{(u'
z)) if ^(v) is withina notoperator,CHAPTER 3. ALGORITHMDESIGN 22
The similarity,
d,
betweenSc
and V is computed asd=
J_
D((v,s),V)
{v,s)esc
D{iv,s),v)
={1
if^eV'
I0 otherwise.
Note that d measures onlythe similarity betweenthe two sets, and not the
dissimilarity (i.e.,
thepresence of additional rulesinV doesnotdetract from thesimilarity score).Theexponentialfunctionsintheconsequent modification equations(lines
11 and
13)
are designed to change the consequent value moredrastically
when its value is significantly different from the ideal. In the case that a
positiverelationshiphasbeen identified
(Sh
is2,
orHI; line10),
rules matching
the environmentthat producedHI Happinessshould increasethe cell's score.Thus,
rules currentlyhaving
a negative consequent value will see alarge
increase,
whereas rules already possessing a positive consequent willsee a smaller one. This behavior is intended to mimic a human modifying
his solution toa problem: inthecase that the solutionis
"way
off,"he may
make largechanges;
however,
ifthe solution isclose, but not quiteright,
hewill mostly
likely
onlytweakitslightly. Inthecasethat a negative relationship has been identified (line
12),
the same method is used, but the idealconsequent value is a negative one.
3.2
Evolutionary
Algorithm
The method for evolving expert systems described here performs a more
powerful expert systemrefinementthan thatpresented
by
Perneelet al. [15]:a set of seed systemsisusedin generatingtheinitialpopulationto
help
limitthe search space to viable systems, but the evolutionary algorithm is able
to add, modify, and remove rules, as well as
being
able to alter membership functions.
Furthermore,
unlikethe methods described in the previouschapter, the evolutionary algorithm operates on complex rules potentially
containing nested operators. These extensions allow the evolutionary algo
rithmto explore amuch largerportion ofthe total potential solution space than theaforementionedapproaches; asthealgorithmisgiven morefreedom
toexplore this space, it becomes lessnecessarythat theset ofsystems used
to seed the initial population contain a wide variety of genetic material,
CHAPTER 3. ALGORITHMDESIGN 23
1
08
06
04
02
0
X
*-'LOW
'MED
HI
[image:33.517.133.376.115.213.2]x i2 x i6
Figure 3.3: Mappingofthesix membershipfunction parameters to three trapezoidal fuzzymembership functions.
3.2.1 Genotype
The phenotype for the evolutionary algorithm is the expert system
itself,
which was described in the last section. The genotype contains the same
information;
however,
inorder to discussgeneticoperators, adescriptionofthegenotype's datarepresentation is required.
Each ruleis composed oftwoparts: theantecedent and theconsequent.
Theantecedent isan expressioncontainingoperators andoperands;since an
operandmay bean expressionin and of
itself,
theantecedent is representedby
a tree, as is generally done in genetic programming. The consequent isa single value, and so is stored as such. The genotype maintains a set of pairings of antecedent treesand consequent valuestorepresenttherules set.
Foreach variabledefined in Section
3.1.2,
threefuzzy
memberships mustbe
defined,
for thefuzzy
sets LOW, MED, and HI. The parametersdefining
each functionare all stored in a singlearray ofthe form:
[a-ll,
X\2, 13, X14, ^15, 16, 21, ,Xn}Thevaluesxn through x^definethe three trapezoidal membershipfunctions
for the ith variable; thisis shown in Figure 3.3.
3.2.2 Crossover
Crossover is performed separately on rule sets and membership
functions;
when two genotypes undergo crossover, both their rules and memberships
are affected. Forthe rulesets, 1-pointcrossoveris used atthe setlevel
(i.e.,
the first n rules arekept,
and the remainder are swapped with the otherparent).
Swapping
of parts of rules occursduring
mutation.1-point crossover is also used for membership
functions; however,
theCHAPTER 3. ALGORITHM DESIGN 24
This limitationprevents theneed forpost-crossovergenetic repair,
because,
within aspecific function
definition,
the function parameters must be non-decreasing.Finally,
the adaptive 9 threshold undergoes 1-point crossover at the bit level.3.2.3 Mutation
Mutation is performed
by
choosing one ofthefollowing
operations at random:
Swap-Parts Swaps subtrees betweentwo randomlyselected rules.
MUTATE-MEMBERSHIPS Choosesamembershipfunctionat random and re
places it with a new, randomly generated membership function. The function generation algorithm ensures that the new parameters are
non-decreasing.
Add-Rule Generates a new rule.
Starting
with the root node, each nodehasa75% chance of
becoming
an operand. Onceall ofthe tree'sleavesare operands or operators
taking
no arguments, the rule is complete. (Note: the algorithm isprevented fromgeneratingrules withonlythe"current-cell"
operation).
Replace-Rule Removes a random rule and generates a new rule to add
in its place.
Remove-Rule Removes a random rule.
Mutate-Cons Choosesanew consequent valueforarandomlychosen rule.
The new value is chosen randomly from a uniform distribution with
range [4,4].
Mutate-Theta Onebit inthe
binary
representation of9 is flipped.3.2.4 Parameters
Table 3.2 definestheparametersused
by
theevolutionaryalgorithm. Fitnessproportional selection is often preferableto truncation selectiondue to the
chance of selecting unfit individuals. This is because an individual may be globally unfit, but still possess useful genetic material; excluding these
CHAPTER3. ALGORITHM DESIGN 25
Parameter Value
Population Size 16
Mutation Rate 0.05
CrossoverRate 0.75
Elitism Rate 0.375
Parent Selection Fitness Proportional
Elitist Selection Truncation
[image:35.517.156.362.106.219.2]SurvivorSelection Fitness Proportional
Table 3.2: Parametersusedbytheevolutionaryalgorithm.
amonggenetic material.
However,
truncationselection was chosen forpicking
the individuals to carry overfrom the previous generationbecause thismethod guaranteesthat the best individuals are chosen. The fullspectrum
of genetic material from the previous generation still has the possibilityof
being
representedthrough crossover, as unfit individualsmaybeselectedas parents.3.2.5 Fitness Calculation
Three fitnessmetrics weredesignedand usedinexperimentation:
coverage-based,
stress-based, and combined. The separatecoverage-based andstress-basedmetrics were usedtodetermineifdifferentrulesetswouldbegenerated
given thesedifferentgoals. The combinedmetricforces the evolutionary al
gorithmtocompromisebetween maximizingcoverage andminimizingstress.
Coverage-Based Fitness
Coverage-based fitness requires that ideal coverage be defined. Here it is
defined in terms ofthe distribution of vegetation levels across the field at
the end ofsimulation; in order to determine the ideal
distribution,
the relationship
betweenthe cattle andthe foragematter, andthe needs ofeach,must beconsidered.
Cattle obtain the greatest nutritional value from re-grazed vegetation,
because when a plant is growing, it is more digestible and provides more
protein; also, plants in earlier stages ofgrowth tend to bejuicier andtaste better to the cattle. Mature plants have greater stem mass, which makes
themless
digestible,
and contain morefiber,
makingthemlesspalatable[1],
CHAPTER 3. ALGORITHM DESIGN 26
are allowed to grow to larger than approximately 75% of their maximum size.
Whentoogreata percentage ofaplant'sleafvolumeisremovedthrough
grazing,
however,
it must consume nutrients stored in its roots to regrowleaves. This results in root growth stoppage, which in turn can lead to a
weakened root system, lossof plant species, and areduction in forage yield
for the animals. Turner et al. and Poole
[1]
both indicate that overgrazingoccurs when plants are allowed to be reduced to less than approximately
halftheir maximum size.
Therefore,
the desiredvegetationdistribution may be modeled asanor maldistributionwith a mean value of66%ofthemaximum vegetation value.This means that the average plant in the field is not so early in its growth cycle that it must suffer root growth stoppage to continue leaf growth if
grazed, and it is also not so mature that it suffers a reduction in nutri
tion or palatibility.
Thus,
coverage-based fitness is calculated as the rawy2
test score when comparing thedistribution ofthe final vegetation levels
ofthe field to the ideal
distribution,
defined as a normal distribution with \x = 168.3 and a = 49.7 (where the maximum vegetation level is 255). A lower x2score indicates a better match between the data and the desired
distribution,
sotheevolutionaryalgorithm should attempt to minimizethis fitness metric.At the completion of a simulation run, the vegetation map is split into
20 meter
by
20 meter cells. Cells with fewer than 50 non-zero values areignored,
inordertoremove major obstaclesfrom consideration. An average level is taken for each cell, and the averages are collected in a histogram.Finally,
thishistogram isusedto perform ax2test,whose result represents
thefitness ofthe expert system in question.
Stress-Based Fitness
Stress-based fitness is calculated similarly to
Happiness,
except that hereit is unhappiness that is
being
determined. For each 15-hour segment ofruntime, the number of shocks per secondis calculated (capped at
1);
over all unhappiness is the mean ofthese values. The goal of the evolutionaryalgorithm is tominimize this metric, as well.
Combined Fitness
The combinedfitness metric calculation is:
/
=CHAPTER 3. ALGORITHM DESIGN 27
where x2
is the coverage-based fitness and u is the stress-based fitness, u
is taken exponentially toplace greater emphasis on low unhappiness values
(i.e.,
to punish severely a system whose overall unhappiness is high). Onceagain, the evolutionary algorithm's goal is to minimize this metric.
Fitness
Short-Circuiting
In orderto saveon bothtime and processing, ashort-circuitingmechanism
is introduced to the fitness calculation. If no attempt to move the cattle
is made within 30 hours (this timeframe chosen for the specific simulation
environment), then thesystem inquestionis arbitrarilyassignedfitnessesof 50.0 and1.0 forthecoverage-and stress-based
metrics, respectively,yielding
a combinedfitnessscore of135.914 (comparethis toatypical set of metrics
for averypoor system: x2 ~
22*0,
u0.5,
/
as 36.272).3.2.6 Initial Population
A small set ofhuman-produced individuals is provided to the initial popu
lation algorithm, allowing ahuman to introduce rules that hebelieves will
be useful, or to introduce systems to be refined. Two systems are selected
randomlyfrom the set of seeds and are crossed over. Each ofthe resulting
childrenismutated. Themutated children are addedtotheset ofseeds, and
the process is repeated untilthe cardinality ofthe seed set is twice the de
sired population size. Atthis point, individuals are selected at random until
the desiredpopulation size is reached; these become the initial population;
Chapter
4
Implementation
and
Evaluation
4.1
Simulator
A simple cattle simulator was developedfor testing. This section describes
its final
functionality;
during
testing,functionality
andcomplexitywere introducedintothesimulator
incrementally
inorder todeterminesystem performancegiven various sets of variables. Latersections
detailing
thevariousexperiments performeddescribe what simulator
functionality
was present.The overall algorithm governing the simulated cattle is quite simple: a
number offorces are generated representing attraction and repulsion from
variousstimuli. Theseforcesareadded, adjustedformaximumturningrate
and speed, and applied to the cow. This process occurs for each second in
simulation time.
Muchofthesimulator