SlideShare a Scribd company logo
1 of 69
Download to read offline
Genetic Algorithms and
Fuzzy Logic
Introduction
īŽ After scientists became disillusioned with
classical and neo-classical attempts at
modeling intelligence, they looked in other
directions.
īŽ Two prominent fields arose, connectionism
(neural networking, parallel processing) and
evolutionary computing.
īŽ It is the latter that this essay deals with -
genetic algorithms and genetic programming.
What is GA
īŽ A genetic algorithm (or GA) is a search technique
used in computing to find true or approximate
solutions to optimization and search problems.
īŽ Genetic algorithms are categorized as global search
heuristics.
īŽ Genetic algorithms are a particular class of
evolutionary algorithms that use techniques inspired
by evolutionary biology such as inheritance,
mutation, selection, and crossover (also called
recombination).
What is GA
īŽ Genetic algorithms are implemented as a computer
simulation in which a population of abstract
representations (called chromosomes or the genotype
or the genome) of candidate solutions (called
individuals, creatures, or phenotypes) to an
optimization problem evolves toward better solutions.
īŽ Traditionally, solutions are represented in binary as
strings of 0s and 1s, but other encodings are also
possible.
What is GA
īŽ The evolution usually starts from a population of
randomly generated individuals and happens in
generations.
īŽ In each generation, the fitness of every individual in
the population is evaluated, multiple individuals are
selected from the current population (based on their
fitness), and modified (recombined and possibly
mutated) to form a new population.
What is GA
īŽ The new population is then used in the next
iteration of the algorithm.
īŽ Commonly, the algorithm terminates when
either a maximum number of generations has
been produced, or a satisfactory fitness level
has been reached for the population.
īŽ If the algorithm has terminated due to a
maximum number of generations, a
satisfactory solution may or may not have been
reached.
7
Simple Genetic Algorithm
produce an initial population of individuals
evaluate the fitness of all individuals
while termination condition not met do
select fitter individuals for reproduction
recombine between individuals
mutate individuals
evaluate the fitness of the modified individuals
generate a new population
End while
Introduction to Genetic Algorithms 8
The Evolutionary Cycle
selection
population evaluation
modification
discard
deleted
members
parents
modified
offspring
evaluated offspring
initiate &
evaluate
Key terms
īŽ Individual - Any possible solution
īŽ Population - Group of all individuals
īŽ Search Space - All possible solutions to the problem
īŽ Chromosome - Blueprint for an individual
īŽ Trait - Possible aspect (features) of an individual
īŽ Allele - Possible settings of trait (black, blond, etc.)
īŽ Locus - The position of a gene on the chromosome
īŽ Genome - Collection of all chromosomes for an
individual
Chromosome, Genes and
Genomes
Genotype and Phenotype
īŽ Genotype:
– Particular set of genes in a genome
īŽ Phenotype:
– Physical characteristic of the genotype
(smart, beautiful, healthy, etc.)
Genotype and Phenotype
GA Requirements
īŽ A typical genetic algorithm requires two things to be defined:
īŽ a genetic representation of the solution domain, and
īŽ a fitness function to evaluate the solution domain.
īŽ A standard representation of the solution is as an array of bits.
Arrays of other types and structures can be used in essentially
the same way.
īŽ The main property that makes these genetic representations
convenient is that their parts are easily aligned due to their
fixed size, that facilitates simple crossover operation.
īŽ Variable length representations may also be used, but
crossover implementation is more complex in this case.
īŽ Tree-like representations are explored in Genetic
programming.
Representation
Chromosomes could be:
īŽ Bit strings (0101 ... 1100)
īŽ Real numbers (43.2 -33.1 ... 0.0 89.2)
īŽ Permutations of element (E11 E3 E7 ... E1 E15)
īŽ Lists of rules (R1 R2 R3 ... R22 R23)
īŽ Program elements (genetic programming)
īŽ ... any data structure ...
GA Requirements
īŽ The fitness function is defined over the genetic representation
and measures the quality of the represented solution.
īŽ The fitness function is always problem dependent.
īŽ For instance, in the knapsack problem we want to maximize
the total value of objects that we can put in a knapsack of some
fixed capacity.
īŽ A representation of a solution might be an array of bits, where
each bit represents a different object, and the value of the bit (0
or 1) represents whether or not the object is in the knapsack.
īŽ Not every such representation is valid, as the size of objects
may exceed the capacity of the knapsack.
īŽ The fitness of the solution is the sum of values of all objects in
the knapsack if the representation is valid, or 0 otherwise. In
some problems, it is hard or even impossible to define the
fitness expression; in these cases, interactive genetic
algorithms are used.
A fitness function
Basics of GA
īŽ The most common type of genetic algorithm works like this:
īŽ a population is created with a group of individuals created
randomly.
īŽ The individuals in the population are then evaluated.
īŽ The evaluation function is provided by the programmer and
gives the individuals a score based on how well they perform
at the given task.
īŽ Two individuals are then selected based on their fitness, the
higher the fitness, the higher the chance of being selected.
īŽ These individuals then "reproduce" to create one or more
offspring, after which the offspring are mutated randomly.
īŽ This continues until a suitable solution has been found or a
certain number of generations have passed, depending on the
needs of the programmer.
General Algorithm for GA
īŽ Initialization
īŽ Initially many individual solutions are randomly
generated to form an initial population. The
population size depends on the nature of the problem,
but typically contains several hundreds or thousands
of possible solutions.
īŽ Traditionally, the population is generated randomly,
covering the entire range of possible solutions (the
search space).
īŽ Occasionally, the solutions may be "seeded" in areas
where optimal solutions are likely to be found.
General Algorithm for GA
īŽ Selection
īŽ During each successive generation, a proportion of the existing
population is selected to breed a new generation.
īŽ Individual solutions are selected through a fitness-based
process, where fitter solutions (as measured by a fitness
function) are typically more likely to be selected.
īŽ Certain selection methods rate the fitness of each solution and
preferentially select the best solutions. Other methods rate only
a random sample of the population, as this process may be
very time-consuming.
īŽ Most functions are stochastic and designed so that a small
proportion of less fit solutions are selected. This helps keep the
diversity of the population large, preventing premature
convergence on poor solutions. Popular and well-studied
selection methods include roulette wheel selection and
tournament selection.
General Algorithm for GA
īŽ In roulette wheel selection, individuals are
given a probability of being selected that is
directly proportionate to their fitness.
īŽ Two individuals are then chosen randomly
based on these probabilities and produce
offspring.
General Algorithm for GA
Roulette Wheel’s Selection Pseudo Code:
for all members of population
sum += fitness of this individual
end for
for all members of population
probability = sum of probabilities + (fitness / sum)
sum of probabilities += probability
end for
loop until new population is full
do this twice
number = Random between 0 and 1
for all members of population
if number > probability but less than next probability then
you have been selected
end for
end
create offspring
end loop
General Algorithm for GA
īŽ Reproduction
īŽ The next step is to generate a second generation population of
solutions from those selected through genetic operators:
crossover (also called recombination), and/or mutation.
īŽ For each new solution to be produced, a pair of "parent"
solutions is selected for breeding from the pool selected
previously.
īŽ By producing a "child" solution using the above methods of
crossover and mutation, a new solution is created which
typically shares many of the characteristics of its "parents".
New parents are selected for each child, and the process
continues until a new population of solutions of appropriate
size is generated.
General Algorithm for GA
īŽ These processes ultimately result in the next
generation population of chromosomes that is
different from the initial generation.
īŽ Generally the average fitness will have
increased by this procedure for the population,
since only the best organisms from the first
generation are selected for breeding, along
with a small proportion of less fit solutions, for
reasons already mentioned above.
Crossover
īŽ the most common type is single point crossover. In single
point crossover, you choose a locus at which you swap the
remaining alleles from on parent to the other. This is complex
and is best understood visually.
īŽ As you can see, the children take one section of the
chromosome from each parent.
īŽ The point at which the chromosome is broken depends on the
randomly selected crossover point.
īŽ This particular method is called single point crossover because
only one crossover point exists. Sometimes only child 1 or
child 2 is created, but oftentimes both offspring are created and
put into the new population.
īŽ Crossover does not always occur, however. Sometimes, based
on a set probability, no crossover occurs and the parents are
copied directly to the new population. The probability of
crossover occurring is usually 60% to 70%.
Crossover
Mutation
īŽ After selection and crossover, you now have a new population
full of individuals.
īŽ Some are directly copied, and others are produced by
crossover.
īŽ In order to ensure that the individuals are not all exactly the
same, you allow for a small chance of mutation.
īŽ You loop through all the alleles of all the individuals, and if
that allele is selected for mutation, you can either change it by
a small amount or replace it with a new value. The probability
of mutation is usually between 1 and 2 tenths of a percent.
īŽ Mutation is fairly simple. You just change the selected alleles
based on what you feel is necessary and move on. Mutation is,
however, vital to ensuring genetic diversity within the
population.
Mutation
General Algorithm for GA
īŽ Termination
īŽ This generational process is repeated until a
termination condition has been reached.
īŽ Common terminating conditions are:
īŽ A solution is found that satisfies minimum criteria
īŽ Fixed number of generations reached
īŽ Allocated budget (computation time/money) reached
īŽ The highest ranking solution's fitness is reaching or has
reached a plateau such that successive iterations no longer
produce better results
īŽ Manual inspection
īŽ Any Combinations of the above
GA Pseudo-code
Choose initial population
Evaluate the fitness of each individual in the population
Repeat
Select best-ranking individuals to reproduce
Breed new generation through crossover and mutation (genetic
operations) and give birth to offspring
Evaluate the individual fitnesses of the offspring
Replace worst ranked part of population with offspring
Until <terminating condition>
Symbolic AI VS. Genetic
Algorithms
īŽ Most symbolic AI systems are very static.
īŽ Most of them can usually only solve one given
specific problem, since their architecture was
designed for whatever that specific problem was in
the first place.
īŽ Thus, if the given problem were somehow to be
changed, these systems could have a hard time
adapting to them, since the algorithm that would
originally arrive to the solution may be either
incorrect or less efficient.
īŽ Genetic algorithms (or GA) were created to combat
these problems; they are basically algorithms based
on natural biological evolution.
Symbolic AI VS. Genetic
Algorithms
īŽ The architecture of systems that implement genetic algorithms
(or GA) are more able to adapt to a wide range of problems.
īŽ A GA functions by generating a large set of possible solutions
to a given problem.
īŽ It then evaluates each of those solutions, and decides on a
"fitness level" (you may recall the phrase: "survival of the
fittest") for each solution set.
īŽ These solutions then breed new solutions.
īŽ The parent solutions that were more "fit" are more likely to
reproduce, while those that were less "fit" are more unlikely to
do so.
īŽ In essence, solutions are evolved over time. This way you
evolve your search space scope to a point where you can find
the solution.
īŽ Genetic algorithms can be incredibly efficient if programmed
correctly.
Genetic Programming
īŽ In programming languages such as LISP, the mathematical
notation is not written in standard notation, but in prefix
notation. Some examples of this:
īŽ + 2 1 : 2 + 1
īŽ * + 2 1 2 : 2 * (2+1)
īŽ * + - 2 1 4 9 : 9 * ((2 - 1) + 4)
īŽ Notice the difference between the left-hand side to the right?
Apart from the order being different, no parenthesis! The
prefix method makes it a lot easier for programmers and
compilers alike, because order precedence is not an issue.
īŽ You can build expression trees out of these strings that then
can be easily evaluated, for example, here are the trees for the
above three expressions.
Genetic Programming
Genetic Programming
īŽ You can see how expression evaluation is thus a lot
easier.
īŽ What this have to do with GAs? If for example you
have numerical data and 'answers', but no expression
to conjoin the data with the answers.
īŽ A genetic algorithm can be used to 'evolve' an
expression tree to create a very close fit to the data.
īŽ By 'splicing' and 'grafting' the trees and evaluating
the resulting expression with the data and testing it to
the answers, the fitness function can return how close
the expression is.
Genetic Programming
īŽ The limitations of genetic programming lie in
the huge search space the GAs have to search
for - an infinite number of equations.
īŽ Therefore, normally before running a GA to
search for an equation, the user tells the
program which operators and numerical ranges
to search under.
īŽ Uses of genetic programming can lie in stock
market prediction, advanced mathematics and
military applications .
Evolving Neural Networks
īŽ Evolving the architecture of neural network is
slightly more complicated, and there have been
several ways of doing it. For small nets, a
simple matrix represents which neuron
connects which, and then this matrix is, in
turn, converted into the necessary 'genes', and
various combinations of these are evolved.
Evolving Neural Networks
īŽ Many would think that a learning function could be
evolved via genetic programming. Unfortunately,
genetic programming combined with neural networks
could be incredibly slow, thus impractical.
īŽ As with many problems, you have to constrain what
you are attempting to create.
īŽ For example, in 1990, David Chalmers attempted to
evolve a function as good as the delta rule.
īŽ He did this by creating a general equation based upon
the delta rule with 8 unknowns, which the genetic
algorithm then evolved.
Other Areas
īŽ Genetic Algorithms can be applied to virtually any problem
that has a large search space.
īŽ Al Biles uses genetic algorithms to filter out 'good' and 'bad'
riffs for jazz improvisation.
īŽ The military uses GAs to evolve equations to differentiate
between different radar returns.
īŽ Stock companies use GA-powered programs to predict the
stock market.
Checkboard example
īŽ We are given an n by n checkboard in which every field
can have a different colour from a set of four colors.
īŽ Goal is to achieve a checkboard in a way that there are no
neighbours with the same color (not diagonal)
1 2 3 4 5 6 7 8 9 10
1
2
3
4
5
6
7
8
9
10
1 2 3 4 5 6 7 8 9 10
1
2
3
4
5
6
7
8
9
10
Checkboard example Cont’d
īŽ Chromosomes represent the way the checkboard is colored.
īŽ Chromosomes are not represented by bitstrings but by
bitmatrices
īŽ The bits in the bitmatrix can have one of the four values 0,
1, 2 or 3, depending on the color.
īŽ Crossing-over involves matrix manipulation instead of
point wise operating.
īŽ Crossing-over can be combining the parential matrices in a
horizontal, vertical, triangular or square way.
īŽ Mutation remains bitwise changing bits in either one of the
other numbers.
Checkboard example Cont’d
â€ĸ This problem can be seen as a graph with n nodes
and (n-1) edges, so the fitness f(x) is defined as:
f(x) = 2 ¡ (n-1) ¡n
Example
īŽ f(x) = {MAX(x2): 0 <= x <= 32 }
īŽ Encode Solution: Just use 5 bits (1 or 0).
īŽ Generate initial population.
īŽ Evaluate each solution against objective.
Sol. String Fitness % of Total
A 01101 169 14.4
B 11000 576 49.2
C 01000 64 5.5
D 10011 361 30.9
A 0 1 1 0 1
B 1 1 0 0 0
C 0 1 0 0 0
D 1 0 0 1 1
Example Cont’d
īŽ Create next generation of solutions
īŽ Probability of “being a parent” depends on the fitness.
īŽ Ways for parents to create next generation
īŽ Reproduction
īŽ Use a string again unmodified.
īŽ Crossover
īŽ Cut and paste portions of one string to another.
īŽ Mutation
īŽ Randomly flip a bit.
īŽ COMBINATION of all of the above.
Checkboard example
īŽ We are given an n by n checkboard in which every field
can have a different colour from a set of four colors.
īŽ Goal is to achieve a checkboard in a way that there are no
neighbours with the same color (not diagonal)
1 2 3 4 5 6 7 8 9 10
1
2
3
4
5
6
7
8
9
10
1 2 3 4 5 6 7 8 9 10
1
2
3
4
5
6
7
8
9
10
Checkboard example Cont’d
īŽ Chromosomes represent the way the checkboard is colored.
īŽ Chromosomes are not represented by bitstrings but by
bitmatrices
īŽ The bits in the bitmatrix can have one of the four values 0,
1, 2 or 3, depending on the color.
īŽ Crossing-over involves matrix manipulation instead of
point wise operating.
īŽ Crossing-over can be combining the parential matrices in a
horizontal, vertical, triangular or square way.
īŽ Mutation remains bitwise changing bits in either one of the
other numbers.
Checkboard example Cont’d
â€ĸ This problem can be seen as a graph with n nodes
and (n-1) edges, so the fitness f(x) is defined as:
f(x) = 2 ¡ (n-1) ¡n
Checkboard example Cont’d
â€ĸ Fitnesscurves for different cross-over rules:
0 100 200 300 400 500
130
140
150
160
170
180
Fitness
Lower-Triangular Crossing Over
0 200 400 600 800
130
140
150
160
170
180
Square Crossing Over
0 200 400 600 800
130
140
150
160
170
180
Generations
Fitness
Horizontal Cutting Crossing Over
0 500 1000 1500
130
140
150
160
170
180
Generations
Verical Cutting Crossing Over
Fuzzy Logic
WHERE DID FUZZY LOGIC COME FROM?
The concept of Fuzzy Logic (FL) was conceived by Lotfi Zadeh, a
professor at the University of California at Berkley, and presented not
as a control methodology, but as a way of processing data by allowing
partial set membership rather than crisp set membership or non-
membership. This approach to set theory was not applied to control
systems until the 70's due to insufficient small-computer capability
prior to that time. Professor Zadeh reasoned that people do not require
precise, numerical information input, and yet they are capable of
highly adaptive control. If feedback controllers could be programmed
to accept noisy, imprecise input, they would be much more effective
and perhaps easier to implement. Unfortunately, U.S. manufacturers
have not been so quick to embrace this technology while the
Europeans and Japanese have been aggressively building real
products around it.
Fuzzy Logic
WHAT IS FUZZY LOGIC?
In this context, FL is a problem-solving control system methodology
that lends itself to implementation in systems ranging from simple,
small, embedded micro-controllers to large, networked, multi-channel
PC or workstation-based data acquisition and control systems. It can
be implemented in hardware, software, or a combination of both. FL
provides a simple way to arrive at a definite conclusion based upon
vague, ambiguous, imprecise, noisy, or missing input information.
FL's approach to control problems mimics how a person would make
decisions, only much faster.
.
HOW IS FL DIFFERENT FROM CONVENTIONAL
CONTROL METHODS?
FL incorporates a simple, rule-based IF X AND Y THEN Z approach
to a solving control problem rather than attempting to model a system
mathematically. The FL model is empirically-based, relying on an
operator's experience rather than their technical understanding of the
system. For example, rather than dealing with temperature control in
terms such as "SP =500F", "T <1000F", or "210C <TEMP <220C",
terms like "IF (process is too cool) AND (process is getting colder)
THEN (add heat to the process)" or "IF (process is too hot) AND
(process is heating rapidly) THEN (cool the process quickly)" are
used. These terms are imprecise and yet very descriptive of what must
actually happen. Consider what you do in the shower if the
temperature is too cold: you will make the water comfortable very
quickly with little trouble. FL is capable of mimicking this type of
behavior but at very high rate.
HOW DOES FL WORK?
FL requires some numerical parameters in order to operate such as
what is considered significant error and significant rate-of-change-of-
error, but exact values of these numbers are usually not critical unless
very responsive performance is required in which case empirical
tuning would determine them. For example, a simple temperature
control system could use a single temperature feedback sensor whose
data is subtracted from the command signal to compute "error" and
then time-differentiated to yield the error slope or rate-of-change-of-
error, hereafter called "error-dot". Error might have units of degs F
and a small error considered to be 2F while a large error is 5F. The
"error-dot" might then have units of degs/min with a small error-dot
being 5F/min and a large one being 15F/min. These values don't have
to be symmetrical and can be "tweaked" once the system is operating
in order to optimize performance. Generally, FL is so forgiving that
the system will probably work the first time without any tweaking.
Fuzzy Logic
FL was conceived as a better method for sorting and handling data but
has proven to be a excellent choice for many control system
applications since it mimics human control logic. It can be built into
anything from small, hand-held products to large computerized
process control systems. It uses an imprecise but very descriptive
language to deal with input data more like a human operator. It is very
robust and forgiving of operator and data input and often works when
first implemented with little or no tuning.
WHY USE FL?
FL offers several unique features that make it a particularly good
choice for many control problems.
1) It is inherently robust since it does not require precise, noise-free
inputs and can be programmed to fail safely if a feedback sensor quits
or is destroyed. The output control is a smooth control function
despite a wide range of input variations.
2) Since the FL controller processes user-defined rules governing the
target control system, it can be modified and tweaked easily to
improve or drastically alter system performance. New sensors can
easily be incorporated into the system simply by generating
appropriate governing rules.
3) FL is not limited to a few feedback inputs and one or two control
outputs, nor is it necessary to measure or compute rate-of-change
parameters in order for it to be implemented. Any sensor data that
provides some indication of a system's actions and reactions is
sufficient. This allows the sensors to be inexpensive and imprecise
thus keeping the overall system cost and complexity low.
WHY USE FL?
FL offers several unique features that make it a particularly good
choice for many control problems.
4) Because of the rule-based operation, any reasonable number of
inputs can be processed (1-8 or more) and numerous outputs (1-4 or
more) generated, although defining the rulebase quickly becomes
complex if too many inputs and outputs are chosen for a single
implementation since rules defining their interrelations must also be
defined. It would be better to break the control system into smaller
chunks and use several smaller FL controllers distributed on the
system, each with more limited responsibilities.
5) FL can control nonlinear systems that would be difficult or
impossible to model mathematically. This opens doors for control
systems that would normally be deemed unfeasible for automation.
HOW IS FL USED?
1) Define the control objectives and criteria: What am I trying to
control? What do I have to do to control the system? What kind of
response do I need? What are the possible (probable) system failure
modes?
2) Determine the input and output relationships and choose a
minimum number of variables for input to the FL engine (typically
error and rate-of-change-of-error).
3) Using the rule-based structure of FL, break the control problem
down into a series of IF X AND Y THEN Z rules that define the
desired system output response for given system input conditions. The
number and complexity of rules depends on the number of input
parameters that are to be processed and the number fuzzy variables
associated with each parameter. If possible, use at least one variable
and its time derivative. Although it is possible to use a single,
instantaneous error parameter without knowing its rate of change, this
cripples the system's ability to minimize overshoot for a step inputs.
HOW IS FL USED?
4) Create FL membership functions that define the meaning (values)
of Input/Output terms used in the rules.
5) Create the necessary pre- and post-processing FL routines if
implementing in S/W, otherwise program the rules into the FL H/W
engine.
6) Test the system, evaluate the results, tune the rules and membership
functions, and retest until satisfactory results are obtained.
Fuzzy Logic
LINGUISTIC VARIABLES
In 1973, Professor Lotfi Zadeh proposed the concept of linguistic or
"fuzzy" variables. Think of them as linguistic objects or words, rather
than numbers. The sensor input is a noun, e.g. "temperature",
"displacement", "velocity", "flow", "pressure", etc. Since error is just
the difference, it can be thought of the same way. The fuzzy variables
themselves are adjectives that modify the variable (e.g. "large
positive" error, "small positive" error ,"zero" error, "small negative"
error, and "large negative" error). As a minimum, one could simply
have "positive", "zero", and "negative" variables for each of the
parameters. Additional ranges such as "very large" and "very small"
could also be added to extend the responsiveness to exceptional or
very nonlinear conditions, but aren't necessary in a basic system.
Fuzzy Logic
THE RULE MATRIX
In the last article the concept of linguistic variables was presented.
The fuzzy parameters of error (command-feedback) and error-dot
(rate-of-change-of-error) were modified by the adjectives "negative",
"zero", and "positive". To picture this, imagine the simplest practical
implementation, a 3-by-3 matrix. The columns represent "negative
error", "zero error", and "positive error" inputs from left to right. The
rows represent "negative", "zero", and "positive" "error-dot" input
from top to bottom. This planar construct is called a rule matrix. It has
two input conditions, "error" and "error-dot", and one output response
conclusion (at the intersection of each row and column). In this case
there are nine possible logical product (AND) output response
conclusions.
Fuzzy Logic
THE RULE MATRIX
Although not absolutely necessary, rule matrices usually have an odd
number of rows and columns to accommodate a "zero" center row and
column region. This may not be needed as long as the functions on
either side of the center overlap somewhat and continuous dithering
of the output is acceptable since the "zero" regions correspond to "no
change" output responses the lack of this region will cause the system
to continually hunt for "zero". It is also possible to have a different
number of rows than columns. This occurs when numerous degrees of
inputs are needed. The maximum number of possible rules is simply
the product of the number of rows and columns, but definition of all
of these rules may not be necessary since some input conditions may
never occur in practical operation. The primary objective of this
construct is to map out the universe of possible inputs while keeping
the system sufficiently under control.
Fuzzy Logic
The first step in implementing FL is to decide exactly what is to be
controlled and how. For example, suppose we want to design a simple
proportional temperature controller with an electric heating element
and a variable-speed cooling fan. A positive signal output calls for 0-
100 percent heat while a negative signal output calls for 0-100 percent
cooling. Control is achieved through proper balance and control of
these two active devices.
Fuzzy Logic
.
.
Fuzzy Logic
Figure 1 - A simple block diagram of the control system.It is
necessary to establish a meaningful system for representing the
linguistic variables in the matrix.
"N" = "negative" error or error-dot input level
"Z" = "zero" error or error-dot input level
"P" = "positive" error or error-dot input level
"H" = "Heat" output response
"-" = "No Change" to current output
"C" = "Cool" output response
Define the minimum number of possible input product combinations
and corresponding output response conclusions using these terms.
For a three-by-three matrix with heating and cooling output
responses, all nine rules will need to be defined. The conclusions to
the rules with the linguistic variables associated with the output
response for each rule are transferred to the matrix.
Fuzzy Logic
.
.
Fuzzy Logic
Figure 2 - Typical control system response Figure 2 shows what
command and error look like in a typical control system relative to the
command setpoint as the system hunts for stability. Definitions are
also shown for this example.
DEFINITIONS:
INPUT#1: ("Error", positive (P), zero (Z), negative (N))
INPUT#2: ("Error-dot", positive (P), zero (Z), negative (N))
CONCLUSION: ("Output", Heat (H), No Change (-), Cool (C))
INPUT#1 System Status
Error = Command-Feedback
P=Too cold, Z=Just right, N=Too hot
INPUT#2 System Status
Error-dot = d(Error)/dt
P=Getting hotter Z=Not changing N=Getting colder
OUTPUT Conclusion & System Response
Output H = Call for heating - = Don't change anything C = Call for cooling
SYSTEM OPERATING RULES
Linguistic rules describing the control system consist of two parts;
an antecedent block (between the IF and THEN) and a consequent
block (following THEN). Depending on the system, it may not be
necessary to evaluate every possible input combination (for 5-by-5
& up matrices) since some may rarely or never occur. By making
this type of evaluation, usually done by an experienced operator,
fewer rules can be evaluated, thus simplifying the processing logic
and perhaps even improving the FL system performance.
Fuzzy Logic
.
.
Figures 3 & 4 - The rule structure.
After transferring the conclusions from the nine rules to the
matrix there is a noticeable symmetry to the matrix. This suggests
(but doesn't guarantee) a reasonably well-behaved (linear)
system. This implementation may prove to be too simplistic for
some control problems, however it does illustrate the process.
Additional degrees of error and error-dot may be included if the
desired system response calls for this. This will increase the
rulebase size and complexity but may also increase the quality of
the control. Figure 4 shows the rule matrix derived from the
previous rules.
Fuzzy Logic
Fuzzy Logic
SUMMARY
Linguistic variables are used to represent an FL system's
operating parameters. The rule matrix is a simple graphical
tool for mapping the FL control system rules. It accommodates
two input variables and expresses their logical product (AND)
as one output response variable. To use, define the system
using plain-English rules based upon the inputs, decide
appropriate output response conclusions, and load these into
the rule matrix.
THANK YOU

More Related Content

What's hot

MACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHMMACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHMPuneet Kulyana
 
Activation functions
Activation functionsActivation functions
Activation functionsPRATEEK SAHU
 
Metaheuristics
MetaheuristicsMetaheuristics
Metaheuristicsossein jain
 
Genetic algorithm ppt
Genetic algorithm pptGenetic algorithm ppt
Genetic algorithm pptMayank Jain
 
Simulated Annealing
Simulated AnnealingSimulated Annealing
Simulated AnnealingJoy Dutta
 
Fuzzy Logic ppt
Fuzzy Logic pptFuzzy Logic ppt
Fuzzy Logic pptRitu Bafna
 
Introduction to Genetic Algorithms
Introduction to Genetic AlgorithmsIntroduction to Genetic Algorithms
Introduction to Genetic AlgorithmsDr. C.V. Suresh Babu
 
Cuckoo search algorithm
Cuckoo search algorithmCuckoo search algorithm
Cuckoo search algorithmAhmed Fouad Ali
 
Gradient descent method
Gradient descent methodGradient descent method
Gradient descent methodSanghyuk Chun
 
Machine Learning With Logistic Regression
Machine Learning  With Logistic RegressionMachine Learning  With Logistic Regression
Machine Learning With Logistic RegressionKnoldus Inc.
 
Evolutionary Algorithms
Evolutionary AlgorithmsEvolutionary Algorithms
Evolutionary AlgorithmsReem Alattas
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}FellowBuddy.com
 
Grey wolf optimizer
Grey wolf optimizerGrey wolf optimizer
Grey wolf optimizerAhmed Fouad Ali
 
Prolog Programming : Basics
Prolog Programming : BasicsProlog Programming : Basics
Prolog Programming : BasicsMitul Desai
 
Perceptron & Neural Networks
Perceptron & Neural NetworksPerceptron & Neural Networks
Perceptron & Neural NetworksNAGUR SHAREEF SHAIK
 
Fuzzy Logic Ppt
Fuzzy Logic PptFuzzy Logic Ppt
Fuzzy Logic Pptrafi
 

What's hot (20)

MACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHMMACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHM
 
Activation functions
Activation functionsActivation functions
Activation functions
 
Metaheuristics
MetaheuristicsMetaheuristics
Metaheuristics
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
 
Genetic algorithm ppt
Genetic algorithm pptGenetic algorithm ppt
Genetic algorithm ppt
 
Ga
GaGa
Ga
 
Simulated Annealing
Simulated AnnealingSimulated Annealing
Simulated Annealing
 
Fuzzy Logic ppt
Fuzzy Logic pptFuzzy Logic ppt
Fuzzy Logic ppt
 
Introduction to Genetic Algorithms
Introduction to Genetic AlgorithmsIntroduction to Genetic Algorithms
Introduction to Genetic Algorithms
 
Cuckoo search algorithm
Cuckoo search algorithmCuckoo search algorithm
Cuckoo search algorithm
 
Gradient descent method
Gradient descent methodGradient descent method
Gradient descent method
 
Machine Learning With Logistic Regression
Machine Learning  With Logistic RegressionMachine Learning  With Logistic Regression
Machine Learning With Logistic Regression
 
Differential evolution
Differential evolutionDifferential evolution
Differential evolution
 
Evolutionary Algorithms
Evolutionary AlgorithmsEvolutionary Algorithms
Evolutionary Algorithms
 
Hill climbing algorithm
Hill climbing algorithmHill climbing algorithm
Hill climbing algorithm
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}
 
Grey wolf optimizer
Grey wolf optimizerGrey wolf optimizer
Grey wolf optimizer
 
Prolog Programming : Basics
Prolog Programming : BasicsProlog Programming : Basics
Prolog Programming : Basics
 
Perceptron & Neural Networks
Perceptron & Neural NetworksPerceptron & Neural Networks
Perceptron & Neural Networks
 
Fuzzy Logic Ppt
Fuzzy Logic PptFuzzy Logic Ppt
Fuzzy Logic Ppt
 

Viewers also liked

Genetic Algorithm by Example
Genetic Algorithm by ExampleGenetic Algorithm by Example
Genetic Algorithm by ExampleNobal Niraula
 
Genetic Algorithms Made Easy
Genetic Algorithms Made EasyGenetic Algorithms Made Easy
Genetic Algorithms Made EasyPrakash Pimpale
 
Fuzzy Logic in the Real World
Fuzzy Logic in the Real WorldFuzzy Logic in the Real World
Fuzzy Logic in the Real WorldBCSLeicester
 
Chapter 5 - Fuzzy Logic
Chapter 5 - Fuzzy LogicChapter 5 - Fuzzy Logic
Chapter 5 - Fuzzy LogicAshique Rasool
 
fuzzy logic
fuzzy logicfuzzy logic
fuzzy logicAnmol Bagga
 
Basics of Soft Computing
Basics of Soft  Computing Basics of Soft  Computing
Basics of Soft Computing Sangeetha Rajesh
 
soft-computing
 soft-computing soft-computing
soft-computingstudent
 
C++ neural networks and fuzzy logic
C++ neural networks and fuzzy logicC++ neural networks and fuzzy logic
C++ neural networks and fuzzy logicJamerson Ramos
 
65487681 60444264-engineering-optimization-theory-and-practice-4th-edition
65487681 60444264-engineering-optimization-theory-and-practice-4th-edition65487681 60444264-engineering-optimization-theory-and-practice-4th-edition
65487681 60444264-engineering-optimization-theory-and-practice-4th-editionAshish Arora
 
Fuzzy logic mis
Fuzzy logic misFuzzy logic mis
Fuzzy logic misQamar Wajid
 
25923852 genetic-algorithms-and-engineering-optimization
25923852 genetic-algorithms-and-engineering-optimization25923852 genetic-algorithms-and-engineering-optimization
25923852 genetic-algorithms-and-engineering-optimizationJYOTIBLOSSOMS
 
Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic AlgorithmsShruti Railkar
 
Introduction to Genetic Algorithms
Introduction to Genetic AlgorithmsIntroduction to Genetic Algorithms
Introduction to Genetic AlgorithmsAhmed Othman
 
Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic AlgorithmsKarthik Sankar
 
Soft computing
Soft computingSoft computing
Soft computingganeshpaul6
 
Application of fuzzy logic
Application of fuzzy logicApplication of fuzzy logic
Application of fuzzy logicViraj Patel
 
Application of genetic algorithm and neuro fuzzy control techniques for auto
Application of genetic algorithm and neuro fuzzy control techniques for autoApplication of genetic algorithm and neuro fuzzy control techniques for auto
Application of genetic algorithm and neuro fuzzy control techniques for autoIAEME Publication
 
Analysis of Parameter using Fuzzy Genetic Algorithm in E-learning System
Analysis of Parameter using Fuzzy Genetic Algorithm in E-learning SystemAnalysis of Parameter using Fuzzy Genetic Algorithm in E-learning System
Analysis of Parameter using Fuzzy Genetic Algorithm in E-learning SystemHarshal Jain
 
Predicting and Optimizing the End Price of an Online Auction using Genetic-Fu...
Predicting and Optimizing the End Price of an Online Auction using Genetic-Fu...Predicting and Optimizing the End Price of an Online Auction using Genetic-Fu...
Predicting and Optimizing the End Price of an Online Auction using Genetic-Fu...Pratheeban Rajendran
 

Viewers also liked (20)

Genetic Algorithm by Example
Genetic Algorithm by ExampleGenetic Algorithm by Example
Genetic Algorithm by Example
 
Genetic Algorithms Made Easy
Genetic Algorithms Made EasyGenetic Algorithms Made Easy
Genetic Algorithms Made Easy
 
Fuzzy Logic in the Real World
Fuzzy Logic in the Real WorldFuzzy Logic in the Real World
Fuzzy Logic in the Real World
 
Chapter 5 - Fuzzy Logic
Chapter 5 - Fuzzy LogicChapter 5 - Fuzzy Logic
Chapter 5 - Fuzzy Logic
 
fuzzy logic
fuzzy logicfuzzy logic
fuzzy logic
 
Basics of Soft Computing
Basics of Soft  Computing Basics of Soft  Computing
Basics of Soft Computing
 
soft-computing
 soft-computing soft-computing
soft-computing
 
C++ neural networks and fuzzy logic
C++ neural networks and fuzzy logicC++ neural networks and fuzzy logic
C++ neural networks and fuzzy logic
 
65487681 60444264-engineering-optimization-theory-and-practice-4th-edition
65487681 60444264-engineering-optimization-theory-and-practice-4th-edition65487681 60444264-engineering-optimization-theory-and-practice-4th-edition
65487681 60444264-engineering-optimization-theory-and-practice-4th-edition
 
Fuzzy logic mis
Fuzzy logic misFuzzy logic mis
Fuzzy logic mis
 
Fuzzy logic
Fuzzy logicFuzzy logic
Fuzzy logic
 
25923852 genetic-algorithms-and-engineering-optimization
25923852 genetic-algorithms-and-engineering-optimization25923852 genetic-algorithms-and-engineering-optimization
25923852 genetic-algorithms-and-engineering-optimization
 
Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithms
 
Introduction to Genetic Algorithms
Introduction to Genetic AlgorithmsIntroduction to Genetic Algorithms
Introduction to Genetic Algorithms
 
Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithms
 
Soft computing
Soft computingSoft computing
Soft computing
 
Application of fuzzy logic
Application of fuzzy logicApplication of fuzzy logic
Application of fuzzy logic
 
Application of genetic algorithm and neuro fuzzy control techniques for auto
Application of genetic algorithm and neuro fuzzy control techniques for autoApplication of genetic algorithm and neuro fuzzy control techniques for auto
Application of genetic algorithm and neuro fuzzy control techniques for auto
 
Analysis of Parameter using Fuzzy Genetic Algorithm in E-learning System
Analysis of Parameter using Fuzzy Genetic Algorithm in E-learning SystemAnalysis of Parameter using Fuzzy Genetic Algorithm in E-learning System
Analysis of Parameter using Fuzzy Genetic Algorithm in E-learning System
 
Predicting and Optimizing the End Price of an Online Auction using Genetic-Fu...
Predicting and Optimizing the End Price of an Online Auction using Genetic-Fu...Predicting and Optimizing the End Price of an Online Auction using Genetic-Fu...
Predicting and Optimizing the End Price of an Online Auction using Genetic-Fu...
 

Similar to RM 701 Genetic Algorithm and Fuzzy Logic lecture

Genetic-Algorithms.ppt
Genetic-Algorithms.pptGenetic-Algorithms.ppt
Genetic-Algorithms.pptNipun85
 
AI_PPT_Genetic-Algorithms.ppt
AI_PPT_Genetic-Algorithms.pptAI_PPT_Genetic-Algorithms.ppt
AI_PPT_Genetic-Algorithms.pptHotTea
 
Genetic-Algorithms forv artificial .ppt
Genetic-Algorithms forv artificial  .pptGenetic-Algorithms forv artificial  .ppt
Genetic-Algorithms forv artificial .pptneelamsanjeevkumar
 
Genetic-Algorithms for machine learning and ai.ppt
Genetic-Algorithms for machine learning and ai.pptGenetic-Algorithms for machine learning and ai.ppt
Genetic-Algorithms for machine learning and ai.pptneelamsanjeevkumar
 
Genetic-Algorithms.ppt
Genetic-Algorithms.pptGenetic-Algorithms.ppt
Genetic-Algorithms.pptssuser2e437f
 
Genetic-Algorithms-computersciencepptnew.ppt
Genetic-Algorithms-computersciencepptnew.pptGenetic-Algorithms-computersciencepptnew.ppt
Genetic-Algorithms-computersciencepptnew.pptFitnessfreaksfam
 
4.Genetic-Algorithms.ppt
4.Genetic-Algorithms.ppt4.Genetic-Algorithms.ppt
4.Genetic-Algorithms.pptRamjiChaurasiya
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithmRespa Peter
 
F043046054
F043046054F043046054
F043046054inventy
 
F043046054
F043046054F043046054
F043046054inventy
 
F043046054
F043046054F043046054
F043046054inventy
 
Parallel evolutionary approach paper
Parallel evolutionary approach paperParallel evolutionary approach paper
Parallel evolutionary approach paperPriti Punia
 
Data Science - Part XIV - Genetic Algorithms
Data Science - Part XIV - Genetic AlgorithmsData Science - Part XIV - Genetic Algorithms
Data Science - Part XIV - Genetic AlgorithmsDerek Kane
 
introduction of genetic algorithm
introduction of genetic algorithmintroduction of genetic algorithm
introduction of genetic algorithmritambharaaatre
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithmsAmna Saeed
 
Genetic Algorithm 2 -.pptx
Genetic Algorithm 2 -.pptxGenetic Algorithm 2 -.pptx
Genetic Algorithm 2 -.pptxTAHANMKH
 
Genetic algorithm fitness function
Genetic algorithm fitness functionGenetic algorithm fitness function
Genetic algorithm fitness functionProf Ansari
 
Genetic algorithms full lecture
Genetic algorithms full lectureGenetic algorithms full lecture
Genetic algorithms full lecturesadiacs
 
A genetic algorithm approach to static job shop scheduling
A genetic algorithm approach to static job shop schedulingA genetic algorithm approach to static job shop scheduling
A genetic algorithm approach to static job shop schedulingNagendra Bvs
 

Similar to RM 701 Genetic Algorithm and Fuzzy Logic lecture (20)

Genetic-Algorithms.ppt
Genetic-Algorithms.pptGenetic-Algorithms.ppt
Genetic-Algorithms.ppt
 
AI_PPT_Genetic-Algorithms.ppt
AI_PPT_Genetic-Algorithms.pptAI_PPT_Genetic-Algorithms.ppt
AI_PPT_Genetic-Algorithms.ppt
 
Genetic-Algorithms forv artificial .ppt
Genetic-Algorithms forv artificial  .pptGenetic-Algorithms forv artificial  .ppt
Genetic-Algorithms forv artificial .ppt
 
Genetic-Algorithms for machine learning and ai.ppt
Genetic-Algorithms for machine learning and ai.pptGenetic-Algorithms for machine learning and ai.ppt
Genetic-Algorithms for machine learning and ai.ppt
 
Genetic-Algorithms.ppt
Genetic-Algorithms.pptGenetic-Algorithms.ppt
Genetic-Algorithms.ppt
 
Genetic-Algorithms-computersciencepptnew.ppt
Genetic-Algorithms-computersciencepptnew.pptGenetic-Algorithms-computersciencepptnew.ppt
Genetic-Algorithms-computersciencepptnew.ppt
 
4.Genetic-Algorithms.ppt
4.Genetic-Algorithms.ppt4.Genetic-Algorithms.ppt
4.Genetic-Algorithms.ppt
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
 
F043046054
F043046054F043046054
F043046054
 
F043046054
F043046054F043046054
F043046054
 
F043046054
F043046054F043046054
F043046054
 
Parallel evolutionary approach paper
Parallel evolutionary approach paperParallel evolutionary approach paper
Parallel evolutionary approach paper
 
Data Science - Part XIV - Genetic Algorithms
Data Science - Part XIV - Genetic AlgorithmsData Science - Part XIV - Genetic Algorithms
Data Science - Part XIV - Genetic Algorithms
 
introduction of genetic algorithm
introduction of genetic algorithmintroduction of genetic algorithm
introduction of genetic algorithm
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithms
 
Genetic Algorithm 2 -.pptx
Genetic Algorithm 2 -.pptxGenetic Algorithm 2 -.pptx
Genetic Algorithm 2 -.pptx
 
Genetic algorithm fitness function
Genetic algorithm fitness functionGenetic algorithm fitness function
Genetic algorithm fitness function
 
Genetic algorithms full lecture
Genetic algorithms full lectureGenetic algorithms full lecture
Genetic algorithms full lecture
 
Gadoc
GadocGadoc
Gadoc
 
A genetic algorithm approach to static job shop scheduling
A genetic algorithm approach to static job shop schedulingA genetic algorithm approach to static job shop scheduling
A genetic algorithm approach to static job shop scheduling
 

More from VIT University (Chennai Campus)

More from VIT University (Chennai Campus) (20)

MEE1005-MAT-FALL19-20-L3
MEE1005-MAT-FALL19-20-L3MEE1005-MAT-FALL19-20-L3
MEE1005-MAT-FALL19-20-L3
 
MEE1005-MAT-FALL19-20-L2
MEE1005-MAT-FALL19-20-L2MEE1005-MAT-FALL19-20-L2
MEE1005-MAT-FALL19-20-L2
 
MEE1005-MAT-FALL19-20-L1
MEE1005-MAT-FALL19-20-L1MEE1005-MAT-FALL19-20-L1
MEE1005-MAT-FALL19-20-L1
 
MEE1002 ENGINEERING MECHANICS-SUM-II-L11
MEE1002 ENGINEERING MECHANICS-SUM-II-L11MEE1002 ENGINEERING MECHANICS-SUM-II-L11
MEE1002 ENGINEERING MECHANICS-SUM-II-L11
 
MEE1002ENGINEERING MECHANICS-SUM-II-L13
MEE1002ENGINEERING MECHANICS-SUM-II-L13MEE1002ENGINEERING MECHANICS-SUM-II-L13
MEE1002ENGINEERING MECHANICS-SUM-II-L13
 
MEE1002 ENGINEERING MECHANICS-SUM-II- L12
MEE1002 ENGINEERING MECHANICS-SUM-II- L12MEE1002 ENGINEERING MECHANICS-SUM-II- L12
MEE1002 ENGINEERING MECHANICS-SUM-II- L12
 
MEE1002 ENGIEERING MECHANICS-SUM-II- L11
MEE1002 ENGIEERING MECHANICS-SUM-II- L11MEE1002 ENGIEERING MECHANICS-SUM-II- L11
MEE1002 ENGIEERING MECHANICS-SUM-II- L11
 
MEE1002 ENGINEERING MECHANICS-SUM-II- L10
MEE1002 ENGINEERING MECHANICS-SUM-II- L10MEE1002 ENGINEERING MECHANICS-SUM-II- L10
MEE1002 ENGINEERING MECHANICS-SUM-II- L10
 
MEE1002 ENGINEERING MECHANICS-SUM-II- L9
MEE1002 ENGINEERING MECHANICS-SUM-II- L9MEE1002 ENGINEERING MECHANICS-SUM-II- L9
MEE1002 ENGINEERING MECHANICS-SUM-II- L9
 
MEE1002 ENGINEERING MECHANICS-SUM-II- L8
MEE1002 ENGINEERING MECHANICS-SUM-II- L8MEE1002 ENGINEERING MECHANICS-SUM-II- L8
MEE1002 ENGINEERING MECHANICS-SUM-II- L8
 
MEE1002 ENGINEERING MECHANICS-SUM-II- L7
MEE1002 ENGINEERING MECHANICS-SUM-II- L7MEE1002 ENGINEERING MECHANICS-SUM-II- L7
MEE1002 ENGINEERING MECHANICS-SUM-II- L7
 
MEE1002-ENGINEERING MECHANICS-SUM-II-L1
MEE1002-ENGINEERING MECHANICS-SUM-II-L1MEE1002-ENGINEERING MECHANICS-SUM-II-L1
MEE1002-ENGINEERING MECHANICS-SUM-II-L1
 
MEE1002-ENGINEERING MECHANICS-SUM-II-L6
MEE1002-ENGINEERING MECHANICS-SUM-II-L6MEE1002-ENGINEERING MECHANICS-SUM-II-L6
MEE1002-ENGINEERING MECHANICS-SUM-II-L6
 
MEE1002-ENGINEERING MECHANICS-SUM-II-L5
MEE1002-ENGINEERING MECHANICS-SUM-II-L5MEE1002-ENGINEERING MECHANICS-SUM-II-L5
MEE1002-ENGINEERING MECHANICS-SUM-II-L5
 
MEE1002-ENGINEERING MECHANICS-SUM-II-L4
MEE1002-ENGINEERING MECHANICS-SUM-II-L4MEE1002-ENGINEERING MECHANICS-SUM-II-L4
MEE1002-ENGINEERING MECHANICS-SUM-II-L4
 
MEE1002-ENGINEERING MECHANICS-SUM-II-L3
MEE1002-ENGINEERING MECHANICS-SUM-II-L3MEE1002-ENGINEERING MECHANICS-SUM-II-L3
MEE1002-ENGINEERING MECHANICS-SUM-II-L3
 
MEE1002-ENGINEERING MECHANICS-SUM-II-L2
MEE1002-ENGINEERING MECHANICS-SUM-II-L2MEE1002-ENGINEERING MECHANICS-SUM-II-L2
MEE1002-ENGINEERING MECHANICS-SUM-II-L2
 
DAIMLER-HUM1721ETHICS AND VALUES-L4
DAIMLER-HUM1721ETHICS AND VALUES-L4DAIMLER-HUM1721ETHICS AND VALUES-L4
DAIMLER-HUM1721ETHICS AND VALUES-L4
 
DAIMLER-HUM1721 ETHICS AND VALUES-L3
DAIMLER-HUM1721 ETHICS AND VALUES-L3DAIMLER-HUM1721 ETHICS AND VALUES-L3
DAIMLER-HUM1721 ETHICS AND VALUES-L3
 
DAIMLER-HUM1721-ETHICS AND VALUES-L2
DAIMLER-HUM1721-ETHICS AND VALUES-L2DAIMLER-HUM1721-ETHICS AND VALUES-L2
DAIMLER-HUM1721-ETHICS AND VALUES-L2
 

Recently uploaded

ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
Dust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEDust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEaurabinda banchhor
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxruthvilladarez
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Visit to a blind student's school🧑‍đŸĻ¯đŸ§‘‍đŸĻ¯(community medicine)
Visit to a blind student's school🧑‍đŸĻ¯đŸ§‘‍đŸĻ¯(community medicine)Visit to a blind student's school🧑‍đŸĻ¯đŸ§‘‍đŸĻ¯(community medicine)
Visit to a blind student's school🧑‍đŸĻ¯đŸ§‘‍đŸĻ¯(community medicine)lakshayb543
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...SeÃĄn Kennedy
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxRosabel UA
 
EMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docxEMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docxElton John Embodo
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataBabyAnnMotar
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationRosabel UA
 

Recently uploaded (20)

ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
Dust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEDust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSE
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docx
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Visit to a blind student's school🧑‍đŸĻ¯đŸ§‘‍đŸĻ¯(community medicine)
Visit to a blind student's school🧑‍đŸĻ¯đŸ§‘‍đŸĻ¯(community medicine)Visit to a blind student's school🧑‍đŸĻ¯đŸ§‘‍đŸĻ¯(community medicine)
Visit to a blind student's school🧑‍đŸĻ¯đŸ§‘‍đŸĻ¯(community medicine)
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptx
 
EMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docxEMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docx
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped data
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translation
 

RM 701 Genetic Algorithm and Fuzzy Logic lecture

  • 2. Introduction īŽ After scientists became disillusioned with classical and neo-classical attempts at modeling intelligence, they looked in other directions. īŽ Two prominent fields arose, connectionism (neural networking, parallel processing) and evolutionary computing. īŽ It is the latter that this essay deals with - genetic algorithms and genetic programming.
  • 3. What is GA īŽ A genetic algorithm (or GA) is a search technique used in computing to find true or approximate solutions to optimization and search problems. īŽ Genetic algorithms are categorized as global search heuristics. īŽ Genetic algorithms are a particular class of evolutionary algorithms that use techniques inspired by evolutionary biology such as inheritance, mutation, selection, and crossover (also called recombination).
  • 4. What is GA īŽ Genetic algorithms are implemented as a computer simulation in which a population of abstract representations (called chromosomes or the genotype or the genome) of candidate solutions (called individuals, creatures, or phenotypes) to an optimization problem evolves toward better solutions. īŽ Traditionally, solutions are represented in binary as strings of 0s and 1s, but other encodings are also possible.
  • 5. What is GA īŽ The evolution usually starts from a population of randomly generated individuals and happens in generations. īŽ In each generation, the fitness of every individual in the population is evaluated, multiple individuals are selected from the current population (based on their fitness), and modified (recombined and possibly mutated) to form a new population.
  • 6. What is GA īŽ The new population is then used in the next iteration of the algorithm. īŽ Commonly, the algorithm terminates when either a maximum number of generations has been produced, or a satisfactory fitness level has been reached for the population. īŽ If the algorithm has terminated due to a maximum number of generations, a satisfactory solution may or may not have been reached.
  • 7. 7 Simple Genetic Algorithm produce an initial population of individuals evaluate the fitness of all individuals while termination condition not met do select fitter individuals for reproduction recombine between individuals mutate individuals evaluate the fitness of the modified individuals generate a new population End while
  • 8. Introduction to Genetic Algorithms 8 The Evolutionary Cycle selection population evaluation modification discard deleted members parents modified offspring evaluated offspring initiate & evaluate
  • 9. Key terms īŽ Individual - Any possible solution īŽ Population - Group of all individuals īŽ Search Space - All possible solutions to the problem īŽ Chromosome - Blueprint for an individual īŽ Trait - Possible aspect (features) of an individual īŽ Allele - Possible settings of trait (black, blond, etc.) īŽ Locus - The position of a gene on the chromosome īŽ Genome - Collection of all chromosomes for an individual
  • 11. Genotype and Phenotype īŽ Genotype: – Particular set of genes in a genome īŽ Phenotype: – Physical characteristic of the genotype (smart, beautiful, healthy, etc.)
  • 13. GA Requirements īŽ A typical genetic algorithm requires two things to be defined: īŽ a genetic representation of the solution domain, and īŽ a fitness function to evaluate the solution domain. īŽ A standard representation of the solution is as an array of bits. Arrays of other types and structures can be used in essentially the same way. īŽ The main property that makes these genetic representations convenient is that their parts are easily aligned due to their fixed size, that facilitates simple crossover operation. īŽ Variable length representations may also be used, but crossover implementation is more complex in this case. īŽ Tree-like representations are explored in Genetic programming.
  • 14. Representation Chromosomes could be: īŽ Bit strings (0101 ... 1100) īŽ Real numbers (43.2 -33.1 ... 0.0 89.2) īŽ Permutations of element (E11 E3 E7 ... E1 E15) īŽ Lists of rules (R1 R2 R3 ... R22 R23) īŽ Program elements (genetic programming) īŽ ... any data structure ...
  • 15. GA Requirements īŽ The fitness function is defined over the genetic representation and measures the quality of the represented solution. īŽ The fitness function is always problem dependent. īŽ For instance, in the knapsack problem we want to maximize the total value of objects that we can put in a knapsack of some fixed capacity. īŽ A representation of a solution might be an array of bits, where each bit represents a different object, and the value of the bit (0 or 1) represents whether or not the object is in the knapsack. īŽ Not every such representation is valid, as the size of objects may exceed the capacity of the knapsack. īŽ The fitness of the solution is the sum of values of all objects in the knapsack if the representation is valid, or 0 otherwise. In some problems, it is hard or even impossible to define the fitness expression; in these cases, interactive genetic algorithms are used.
  • 17. Basics of GA īŽ The most common type of genetic algorithm works like this: īŽ a population is created with a group of individuals created randomly. īŽ The individuals in the population are then evaluated. īŽ The evaluation function is provided by the programmer and gives the individuals a score based on how well they perform at the given task. īŽ Two individuals are then selected based on their fitness, the higher the fitness, the higher the chance of being selected. īŽ These individuals then "reproduce" to create one or more offspring, after which the offspring are mutated randomly. īŽ This continues until a suitable solution has been found or a certain number of generations have passed, depending on the needs of the programmer.
  • 18. General Algorithm for GA īŽ Initialization īŽ Initially many individual solutions are randomly generated to form an initial population. The population size depends on the nature of the problem, but typically contains several hundreds or thousands of possible solutions. īŽ Traditionally, the population is generated randomly, covering the entire range of possible solutions (the search space). īŽ Occasionally, the solutions may be "seeded" in areas where optimal solutions are likely to be found.
  • 19. General Algorithm for GA īŽ Selection īŽ During each successive generation, a proportion of the existing population is selected to breed a new generation. īŽ Individual solutions are selected through a fitness-based process, where fitter solutions (as measured by a fitness function) are typically more likely to be selected. īŽ Certain selection methods rate the fitness of each solution and preferentially select the best solutions. Other methods rate only a random sample of the population, as this process may be very time-consuming. īŽ Most functions are stochastic and designed so that a small proportion of less fit solutions are selected. This helps keep the diversity of the population large, preventing premature convergence on poor solutions. Popular and well-studied selection methods include roulette wheel selection and tournament selection.
  • 20. General Algorithm for GA īŽ In roulette wheel selection, individuals are given a probability of being selected that is directly proportionate to their fitness. īŽ Two individuals are then chosen randomly based on these probabilities and produce offspring.
  • 21. General Algorithm for GA Roulette Wheel’s Selection Pseudo Code: for all members of population sum += fitness of this individual end for for all members of population probability = sum of probabilities + (fitness / sum) sum of probabilities += probability end for loop until new population is full do this twice number = Random between 0 and 1 for all members of population if number > probability but less than next probability then you have been selected end for end create offspring end loop
  • 22. General Algorithm for GA īŽ Reproduction īŽ The next step is to generate a second generation population of solutions from those selected through genetic operators: crossover (also called recombination), and/or mutation. īŽ For each new solution to be produced, a pair of "parent" solutions is selected for breeding from the pool selected previously. īŽ By producing a "child" solution using the above methods of crossover and mutation, a new solution is created which typically shares many of the characteristics of its "parents". New parents are selected for each child, and the process continues until a new population of solutions of appropriate size is generated.
  • 23. General Algorithm for GA īŽ These processes ultimately result in the next generation population of chromosomes that is different from the initial generation. īŽ Generally the average fitness will have increased by this procedure for the population, since only the best organisms from the first generation are selected for breeding, along with a small proportion of less fit solutions, for reasons already mentioned above.
  • 24. Crossover īŽ the most common type is single point crossover. In single point crossover, you choose a locus at which you swap the remaining alleles from on parent to the other. This is complex and is best understood visually. īŽ As you can see, the children take one section of the chromosome from each parent. īŽ The point at which the chromosome is broken depends on the randomly selected crossover point. īŽ This particular method is called single point crossover because only one crossover point exists. Sometimes only child 1 or child 2 is created, but oftentimes both offspring are created and put into the new population. īŽ Crossover does not always occur, however. Sometimes, based on a set probability, no crossover occurs and the parents are copied directly to the new population. The probability of crossover occurring is usually 60% to 70%.
  • 26. Mutation īŽ After selection and crossover, you now have a new population full of individuals. īŽ Some are directly copied, and others are produced by crossover. īŽ In order to ensure that the individuals are not all exactly the same, you allow for a small chance of mutation. īŽ You loop through all the alleles of all the individuals, and if that allele is selected for mutation, you can either change it by a small amount or replace it with a new value. The probability of mutation is usually between 1 and 2 tenths of a percent. īŽ Mutation is fairly simple. You just change the selected alleles based on what you feel is necessary and move on. Mutation is, however, vital to ensuring genetic diversity within the population.
  • 28. General Algorithm for GA īŽ Termination īŽ This generational process is repeated until a termination condition has been reached. īŽ Common terminating conditions are: īŽ A solution is found that satisfies minimum criteria īŽ Fixed number of generations reached īŽ Allocated budget (computation time/money) reached īŽ The highest ranking solution's fitness is reaching or has reached a plateau such that successive iterations no longer produce better results īŽ Manual inspection īŽ Any Combinations of the above
  • 29. GA Pseudo-code Choose initial population Evaluate the fitness of each individual in the population Repeat Select best-ranking individuals to reproduce Breed new generation through crossover and mutation (genetic operations) and give birth to offspring Evaluate the individual fitnesses of the offspring Replace worst ranked part of population with offspring Until <terminating condition>
  • 30. Symbolic AI VS. Genetic Algorithms īŽ Most symbolic AI systems are very static. īŽ Most of them can usually only solve one given specific problem, since their architecture was designed for whatever that specific problem was in the first place. īŽ Thus, if the given problem were somehow to be changed, these systems could have a hard time adapting to them, since the algorithm that would originally arrive to the solution may be either incorrect or less efficient. īŽ Genetic algorithms (or GA) were created to combat these problems; they are basically algorithms based on natural biological evolution.
  • 31. Symbolic AI VS. Genetic Algorithms īŽ The architecture of systems that implement genetic algorithms (or GA) are more able to adapt to a wide range of problems. īŽ A GA functions by generating a large set of possible solutions to a given problem. īŽ It then evaluates each of those solutions, and decides on a "fitness level" (you may recall the phrase: "survival of the fittest") for each solution set. īŽ These solutions then breed new solutions. īŽ The parent solutions that were more "fit" are more likely to reproduce, while those that were less "fit" are more unlikely to do so. īŽ In essence, solutions are evolved over time. This way you evolve your search space scope to a point where you can find the solution. īŽ Genetic algorithms can be incredibly efficient if programmed correctly.
  • 32. Genetic Programming īŽ In programming languages such as LISP, the mathematical notation is not written in standard notation, but in prefix notation. Some examples of this: īŽ + 2 1 : 2 + 1 īŽ * + 2 1 2 : 2 * (2+1) īŽ * + - 2 1 4 9 : 9 * ((2 - 1) + 4) īŽ Notice the difference between the left-hand side to the right? Apart from the order being different, no parenthesis! The prefix method makes it a lot easier for programmers and compilers alike, because order precedence is not an issue. īŽ You can build expression trees out of these strings that then can be easily evaluated, for example, here are the trees for the above three expressions.
  • 34. Genetic Programming īŽ You can see how expression evaluation is thus a lot easier. īŽ What this have to do with GAs? If for example you have numerical data and 'answers', but no expression to conjoin the data with the answers. īŽ A genetic algorithm can be used to 'evolve' an expression tree to create a very close fit to the data. īŽ By 'splicing' and 'grafting' the trees and evaluating the resulting expression with the data and testing it to the answers, the fitness function can return how close the expression is.
  • 35. Genetic Programming īŽ The limitations of genetic programming lie in the huge search space the GAs have to search for - an infinite number of equations. īŽ Therefore, normally before running a GA to search for an equation, the user tells the program which operators and numerical ranges to search under. īŽ Uses of genetic programming can lie in stock market prediction, advanced mathematics and military applications .
  • 36. Evolving Neural Networks īŽ Evolving the architecture of neural network is slightly more complicated, and there have been several ways of doing it. For small nets, a simple matrix represents which neuron connects which, and then this matrix is, in turn, converted into the necessary 'genes', and various combinations of these are evolved.
  • 37. Evolving Neural Networks īŽ Many would think that a learning function could be evolved via genetic programming. Unfortunately, genetic programming combined with neural networks could be incredibly slow, thus impractical. īŽ As with many problems, you have to constrain what you are attempting to create. īŽ For example, in 1990, David Chalmers attempted to evolve a function as good as the delta rule. īŽ He did this by creating a general equation based upon the delta rule with 8 unknowns, which the genetic algorithm then evolved.
  • 38. Other Areas īŽ Genetic Algorithms can be applied to virtually any problem that has a large search space. īŽ Al Biles uses genetic algorithms to filter out 'good' and 'bad' riffs for jazz improvisation. īŽ The military uses GAs to evolve equations to differentiate between different radar returns. īŽ Stock companies use GA-powered programs to predict the stock market.
  • 39. Checkboard example īŽ We are given an n by n checkboard in which every field can have a different colour from a set of four colors. īŽ Goal is to achieve a checkboard in a way that there are no neighbours with the same color (not diagonal) 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10
  • 40. Checkboard example Cont’d īŽ Chromosomes represent the way the checkboard is colored. īŽ Chromosomes are not represented by bitstrings but by bitmatrices īŽ The bits in the bitmatrix can have one of the four values 0, 1, 2 or 3, depending on the color. īŽ Crossing-over involves matrix manipulation instead of point wise operating. īŽ Crossing-over can be combining the parential matrices in a horizontal, vertical, triangular or square way. īŽ Mutation remains bitwise changing bits in either one of the other numbers.
  • 41. Checkboard example Cont’d â€ĸ This problem can be seen as a graph with n nodes and (n-1) edges, so the fitness f(x) is defined as: f(x) = 2 ¡ (n-1) ¡n
  • 42. Example īŽ f(x) = {MAX(x2): 0 <= x <= 32 } īŽ Encode Solution: Just use 5 bits (1 or 0). īŽ Generate initial population. īŽ Evaluate each solution against objective. Sol. String Fitness % of Total A 01101 169 14.4 B 11000 576 49.2 C 01000 64 5.5 D 10011 361 30.9 A 0 1 1 0 1 B 1 1 0 0 0 C 0 1 0 0 0 D 1 0 0 1 1
  • 43. Example Cont’d īŽ Create next generation of solutions īŽ Probability of “being a parent” depends on the fitness. īŽ Ways for parents to create next generation īŽ Reproduction īŽ Use a string again unmodified. īŽ Crossover īŽ Cut and paste portions of one string to another. īŽ Mutation īŽ Randomly flip a bit. īŽ COMBINATION of all of the above.
  • 44. Checkboard example īŽ We are given an n by n checkboard in which every field can have a different colour from a set of four colors. īŽ Goal is to achieve a checkboard in a way that there are no neighbours with the same color (not diagonal) 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10
  • 45. Checkboard example Cont’d īŽ Chromosomes represent the way the checkboard is colored. īŽ Chromosomes are not represented by bitstrings but by bitmatrices īŽ The bits in the bitmatrix can have one of the four values 0, 1, 2 or 3, depending on the color. īŽ Crossing-over involves matrix manipulation instead of point wise operating. īŽ Crossing-over can be combining the parential matrices in a horizontal, vertical, triangular or square way. īŽ Mutation remains bitwise changing bits in either one of the other numbers.
  • 46. Checkboard example Cont’d â€ĸ This problem can be seen as a graph with n nodes and (n-1) edges, so the fitness f(x) is defined as: f(x) = 2 ¡ (n-1) ¡n
  • 47. Checkboard example Cont’d â€ĸ Fitnesscurves for different cross-over rules: 0 100 200 300 400 500 130 140 150 160 170 180 Fitness Lower-Triangular Crossing Over 0 200 400 600 800 130 140 150 160 170 180 Square Crossing Over 0 200 400 600 800 130 140 150 160 170 180 Generations Fitness Horizontal Cutting Crossing Over 0 500 1000 1500 130 140 150 160 170 180 Generations Verical Cutting Crossing Over
  • 48. Fuzzy Logic WHERE DID FUZZY LOGIC COME FROM? The concept of Fuzzy Logic (FL) was conceived by Lotfi Zadeh, a professor at the University of California at Berkley, and presented not as a control methodology, but as a way of processing data by allowing partial set membership rather than crisp set membership or non- membership. This approach to set theory was not applied to control systems until the 70's due to insufficient small-computer capability prior to that time. Professor Zadeh reasoned that people do not require precise, numerical information input, and yet they are capable of highly adaptive control. If feedback controllers could be programmed to accept noisy, imprecise input, they would be much more effective and perhaps easier to implement. Unfortunately, U.S. manufacturers have not been so quick to embrace this technology while the Europeans and Japanese have been aggressively building real products around it.
  • 49. Fuzzy Logic WHAT IS FUZZY LOGIC? In this context, FL is a problem-solving control system methodology that lends itself to implementation in systems ranging from simple, small, embedded micro-controllers to large, networked, multi-channel PC or workstation-based data acquisition and control systems. It can be implemented in hardware, software, or a combination of both. FL provides a simple way to arrive at a definite conclusion based upon vague, ambiguous, imprecise, noisy, or missing input information. FL's approach to control problems mimics how a person would make decisions, only much faster. .
  • 50. HOW IS FL DIFFERENT FROM CONVENTIONAL CONTROL METHODS? FL incorporates a simple, rule-based IF X AND Y THEN Z approach to a solving control problem rather than attempting to model a system mathematically. The FL model is empirically-based, relying on an operator's experience rather than their technical understanding of the system. For example, rather than dealing with temperature control in terms such as "SP =500F", "T <1000F", or "210C <TEMP <220C", terms like "IF (process is too cool) AND (process is getting colder) THEN (add heat to the process)" or "IF (process is too hot) AND (process is heating rapidly) THEN (cool the process quickly)" are used. These terms are imprecise and yet very descriptive of what must actually happen. Consider what you do in the shower if the temperature is too cold: you will make the water comfortable very quickly with little trouble. FL is capable of mimicking this type of behavior but at very high rate.
  • 51. HOW DOES FL WORK? FL requires some numerical parameters in order to operate such as what is considered significant error and significant rate-of-change-of- error, but exact values of these numbers are usually not critical unless very responsive performance is required in which case empirical tuning would determine them. For example, a simple temperature control system could use a single temperature feedback sensor whose data is subtracted from the command signal to compute "error" and then time-differentiated to yield the error slope or rate-of-change-of- error, hereafter called "error-dot". Error might have units of degs F and a small error considered to be 2F while a large error is 5F. The "error-dot" might then have units of degs/min with a small error-dot being 5F/min and a large one being 15F/min. These values don't have to be symmetrical and can be "tweaked" once the system is operating in order to optimize performance. Generally, FL is so forgiving that the system will probably work the first time without any tweaking.
  • 52. Fuzzy Logic FL was conceived as a better method for sorting and handling data but has proven to be a excellent choice for many control system applications since it mimics human control logic. It can be built into anything from small, hand-held products to large computerized process control systems. It uses an imprecise but very descriptive language to deal with input data more like a human operator. It is very robust and forgiving of operator and data input and often works when first implemented with little or no tuning.
  • 53. WHY USE FL? FL offers several unique features that make it a particularly good choice for many control problems. 1) It is inherently robust since it does not require precise, noise-free inputs and can be programmed to fail safely if a feedback sensor quits or is destroyed. The output control is a smooth control function despite a wide range of input variations. 2) Since the FL controller processes user-defined rules governing the target control system, it can be modified and tweaked easily to improve or drastically alter system performance. New sensors can easily be incorporated into the system simply by generating appropriate governing rules. 3) FL is not limited to a few feedback inputs and one or two control outputs, nor is it necessary to measure or compute rate-of-change parameters in order for it to be implemented. Any sensor data that provides some indication of a system's actions and reactions is sufficient. This allows the sensors to be inexpensive and imprecise thus keeping the overall system cost and complexity low.
  • 54. WHY USE FL? FL offers several unique features that make it a particularly good choice for many control problems. 4) Because of the rule-based operation, any reasonable number of inputs can be processed (1-8 or more) and numerous outputs (1-4 or more) generated, although defining the rulebase quickly becomes complex if too many inputs and outputs are chosen for a single implementation since rules defining their interrelations must also be defined. It would be better to break the control system into smaller chunks and use several smaller FL controllers distributed on the system, each with more limited responsibilities. 5) FL can control nonlinear systems that would be difficult or impossible to model mathematically. This opens doors for control systems that would normally be deemed unfeasible for automation.
  • 55. HOW IS FL USED? 1) Define the control objectives and criteria: What am I trying to control? What do I have to do to control the system? What kind of response do I need? What are the possible (probable) system failure modes? 2) Determine the input and output relationships and choose a minimum number of variables for input to the FL engine (typically error and rate-of-change-of-error). 3) Using the rule-based structure of FL, break the control problem down into a series of IF X AND Y THEN Z rules that define the desired system output response for given system input conditions. The number and complexity of rules depends on the number of input parameters that are to be processed and the number fuzzy variables associated with each parameter. If possible, use at least one variable and its time derivative. Although it is possible to use a single, instantaneous error parameter without knowing its rate of change, this cripples the system's ability to minimize overshoot for a step inputs.
  • 56. HOW IS FL USED? 4) Create FL membership functions that define the meaning (values) of Input/Output terms used in the rules. 5) Create the necessary pre- and post-processing FL routines if implementing in S/W, otherwise program the rules into the FL H/W engine. 6) Test the system, evaluate the results, tune the rules and membership functions, and retest until satisfactory results are obtained.
  • 57. Fuzzy Logic LINGUISTIC VARIABLES In 1973, Professor Lotfi Zadeh proposed the concept of linguistic or "fuzzy" variables. Think of them as linguistic objects or words, rather than numbers. The sensor input is a noun, e.g. "temperature", "displacement", "velocity", "flow", "pressure", etc. Since error is just the difference, it can be thought of the same way. The fuzzy variables themselves are adjectives that modify the variable (e.g. "large positive" error, "small positive" error ,"zero" error, "small negative" error, and "large negative" error). As a minimum, one could simply have "positive", "zero", and "negative" variables for each of the parameters. Additional ranges such as "very large" and "very small" could also be added to extend the responsiveness to exceptional or very nonlinear conditions, but aren't necessary in a basic system.
  • 58. Fuzzy Logic THE RULE MATRIX In the last article the concept of linguistic variables was presented. The fuzzy parameters of error (command-feedback) and error-dot (rate-of-change-of-error) were modified by the adjectives "negative", "zero", and "positive". To picture this, imagine the simplest practical implementation, a 3-by-3 matrix. The columns represent "negative error", "zero error", and "positive error" inputs from left to right. The rows represent "negative", "zero", and "positive" "error-dot" input from top to bottom. This planar construct is called a rule matrix. It has two input conditions, "error" and "error-dot", and one output response conclusion (at the intersection of each row and column). In this case there are nine possible logical product (AND) output response conclusions.
  • 59. Fuzzy Logic THE RULE MATRIX Although not absolutely necessary, rule matrices usually have an odd number of rows and columns to accommodate a "zero" center row and column region. This may not be needed as long as the functions on either side of the center overlap somewhat and continuous dithering of the output is acceptable since the "zero" regions correspond to "no change" output responses the lack of this region will cause the system to continually hunt for "zero". It is also possible to have a different number of rows than columns. This occurs when numerous degrees of inputs are needed. The maximum number of possible rules is simply the product of the number of rows and columns, but definition of all of these rules may not be necessary since some input conditions may never occur in practical operation. The primary objective of this construct is to map out the universe of possible inputs while keeping the system sufficiently under control.
  • 60. Fuzzy Logic The first step in implementing FL is to decide exactly what is to be controlled and how. For example, suppose we want to design a simple proportional temperature controller with an electric heating element and a variable-speed cooling fan. A positive signal output calls for 0- 100 percent heat while a negative signal output calls for 0-100 percent cooling. Control is achieved through proper balance and control of these two active devices.
  • 62. Fuzzy Logic Figure 1 - A simple block diagram of the control system.It is necessary to establish a meaningful system for representing the linguistic variables in the matrix. "N" = "negative" error or error-dot input level "Z" = "zero" error or error-dot input level "P" = "positive" error or error-dot input level "H" = "Heat" output response "-" = "No Change" to current output "C" = "Cool" output response Define the minimum number of possible input product combinations and corresponding output response conclusions using these terms. For a three-by-three matrix with heating and cooling output responses, all nine rules will need to be defined. The conclusions to the rules with the linguistic variables associated with the output response for each rule are transferred to the matrix.
  • 64. Fuzzy Logic Figure 2 - Typical control system response Figure 2 shows what command and error look like in a typical control system relative to the command setpoint as the system hunts for stability. Definitions are also shown for this example. DEFINITIONS: INPUT#1: ("Error", positive (P), zero (Z), negative (N)) INPUT#2: ("Error-dot", positive (P), zero (Z), negative (N)) CONCLUSION: ("Output", Heat (H), No Change (-), Cool (C)) INPUT#1 System Status Error = Command-Feedback P=Too cold, Z=Just right, N=Too hot INPUT#2 System Status Error-dot = d(Error)/dt P=Getting hotter Z=Not changing N=Getting colder OUTPUT Conclusion & System Response Output H = Call for heating - = Don't change anything C = Call for cooling
  • 65. SYSTEM OPERATING RULES Linguistic rules describing the control system consist of two parts; an antecedent block (between the IF and THEN) and a consequent block (following THEN). Depending on the system, it may not be necessary to evaluate every possible input combination (for 5-by-5 & up matrices) since some may rarely or never occur. By making this type of evaluation, usually done by an experienced operator, fewer rules can be evaluated, thus simplifying the processing logic and perhaps even improving the FL system performance. Fuzzy Logic
  • 66. . .
  • 67. Figures 3 & 4 - The rule structure. After transferring the conclusions from the nine rules to the matrix there is a noticeable symmetry to the matrix. This suggests (but doesn't guarantee) a reasonably well-behaved (linear) system. This implementation may prove to be too simplistic for some control problems, however it does illustrate the process. Additional degrees of error and error-dot may be included if the desired system response calls for this. This will increase the rulebase size and complexity but may also increase the quality of the control. Figure 4 shows the rule matrix derived from the previous rules. Fuzzy Logic
  • 68. Fuzzy Logic SUMMARY Linguistic variables are used to represent an FL system's operating parameters. The rule matrix is a simple graphical tool for mapping the FL control system rules. It accommodates two input variables and expresses their logical product (AND) as one output response variable. To use, define the system using plain-English rules based upon the inputs, decide appropriate output response conclusions, and load these into the rule matrix.