CAPÍTULO II: LA PLANIFICACIÓN ESTRATÉGICA Y EL BALANCE SCORECARD
2.6 El Medio Ambiente Interno: Fortalezas y Debilidades
From the foregoing analysis of the old system, the following objects were identified and formulated for the proposed system:
Table 3.3: Object description/ Responsibility
S/N OBJECT DESCRIPTION & RESPONSIBILITY
1. TV White Space TV channels freed up when a state transitions from Analog TV (ATV) to Digital TV (DTV)
2. TVBD TV Band Device is a low power transmitter that operates in an unoccupied TV channel in the range of channels 2-51, excluding channels 3-4 and 37
User Interface
Agenda
Geolocation Database Response
Query
Inference Engine
Knowledge Base
Formatting of KB
Fitness function Evaluation
Optimization of composition
Optimization Genetic Algorithm System
Working Memory Request
for white space
Figure 3.12: New System Model
99
S/N OBJECT DESCRIPTION & RESPONSIBILITY
3. TV Bands Database
This is a service that TVBDs must contact to submit their operational location and obtain TV channels availability.
4. Rule A relationship between clauses and depending on the situation can be used to generate new information or prove the truth of an assertion 5. Knowledge Base A set of if-then rules and known facts
6. Clause Assertions or facts
7. Inference Engine A collection of reasoning logic used to process the rules and data.
8. Scanner A custom made object with the capability of sensing free and unoccupied channels and assigning same to secondary users.
9. Cognitive Radio an intelligent wireless communication system that is aware of its surrounding environment
10. Genetic Algorithm Uses the principle of selection and mutation to select best fit individuals from a population sample in a search space
11. Chromosome Blueprint for an individual 12. Population A collection of individuals
13. Individual Any possible solution. In our case any possible free and unoccupied channel.
14. Search Space All possible solutions to the problem. In our case, all available frequency bands in a geographical location.
15. Trait Possible aspect of an individual 16. Allele Possible setting for a trait
17. Locus The position of a gene in a chromosome
100
S/N OBJECT DESCRIPTION & RESPONSIBILITY
18. Genome Collection of chromosomes for an individual
19. Simulator An object that simulates signal sensing and allocation to secondary Users.
20. Optimizer This object, optimizes the allocation of free unoccupied channels to devices with aid of Inference Engine and Cognitive Radio
RULE: A Rule for determining if a vehicle is a Sport_Car is typically of the form.
Figure 3.13: A sample Rule to determine that a vehicle is a Sports_car.
SportsCar:
IF vehicleType = automobile AND size = small AND num_doors = 2 THEN vehicle = Sports_car
Rule
ID Antecedent
Clause
Conjunction
Consequen t Clause
101
From the diagram, one can deduce that a Rule is made of:
i) An ID (Rule Id) ii) Antecedent Clause iii) Consequent Clause iv) Conjunctions
Figure 3.13 Rule Class Diagram
The Rule Class is composed of the Clause and Conjunction Class.
CLAUSE: A clause is usually made up of a Rule Variable on the Left Hand Side (LHS), a Condition which tests equality, greater than or less than, and on the Right Hand Side (RHS) a value, which in our implementation is a String (symbolic or numeric). The following diagram illustrates this concept clearly.
Rule
<<Class>>
-ruleid: String
-antecedent: Clause[1..n]
-consequent: Clause
-conjunction: Conjunction[1..n]
+getRuleId(): String
+getAntecedent(): Clause[1..n]
+getConsequent(): Clause +getConjunction(): Conjunction +setRuleId(para: String)
+setAntecedent(para:Clause[1..n]) +setConsequent(): Clause
+setConjunction(para: Conjunction)
vehicleType = automobile
Rule Variable
Value
Condition Figure 3.14: A Sample Clause
102 Basically speaking, a Clause is made up of
i) Rule Variable ii) Condition iii) Value
From the foregoing, one can easily deduce a Composition Relation between Clause and its constituents Rule Variable and Condition Classes. It is therefore safe to say that the Clause class has a Rule Variable and Condition Class.
Figure 3.15: Clause Class Diagram Clause
<<Class>>
-ruleVariable: RuleVariable -condition: Condition Value: Object
+getRuleVariable(): RuleVariable +getAntecedent(): Clause[1..n]
+getConsequent(): Clause +getConjunction(): Conjunction +setRuleId(para: String)
+setAntecedent(para:Clause[1..n]) +setConsequent(para: Clause) +setConjunction(para: Conjunction)
Variable
<<Abstract Class>>
- name: String -value: Object -position: Integer -labels: Collection +getName(): String +getValue():Object +getLabels(): Collection +getPosition(): Integer +setName(para: String) +setValue(para: Object) +setLabels(para: Collection) +setPosition(para: Conjunction)
RuleVariable
<<Class>>
- name: String -value: Object -position: Integer -labels: Collection +getName(): String +getValue():Object +getLabels(): Collection +getPosition(): Integer +setName(para: String) +setValue(para: Object) +setLabels(para: Collection) +setPosition(para: Conjunction)
<<extends>>
Figure 3.16: Class Diagram of RuleVariable showing Is-A (inheritance) relationship between Variable and RuleVariable classes.
103
The diagram above depicts a typical is-a or inheritance relationship between a supper class –i.e that is the class with attributes and method to be inherited-(Variable) and a sub class – a class that inherits the attributes and methods of another class-(RuleVariable)
Figure 3.17: Class Diagram of Condition and Symbol Class respectively
Figure 3.18: Genetic Algorithm and Individual Class Diagram Condition
<<Class>>
-symbol: Symbol -index: Integer
+getSymbol(): Symbol +getIndex(): Integer +setSymbol(para: Symbol) +setAntecedent(para:Integer)
Symbol
<<Class>>
-sign: String
-status: Enumeration(“Equality”,”Less Than”,”Greater Than”)
+getSymbol(): Symbol +getStatus(): Integer +setSymbol(para: Symbol) +setStatus(para:Enum)
Individual
<<Class>>
-geneLength: Integer -genes: byte[]
-fitness:Integer +getLength(): Integer
+generateIndividuals(): Integer[]
-getGene():Integer
+setMembersl(para: Chromosome) +setLength(para:Integer)
+setGene(para:Integer) +getFitness():Integer +toString(): String GeneticAlgorithm
<<Class>>
-population: Population -generationCount: Integer +getPopulation(): Population +getGenerationCount(): Integer +setPopulation(para: Population) +setGenerationCount(para: Integer) +initialiseGenerationCount()
104 CognitiveRadio
<<Class>>
-signalStrength: Integer -transmittingRadius: Integer - longitude: Integer
-latitude: Integer -location: String
-adjacentChannels: CognitiveRadio +getRuleVariable(): RuleVariable +getAntecedent(): Clause[1..n]
+getConsequent(): Clause +getConjunction(): Conjunction +setRuleId(para: String)
+setAntecedent(para:Clause[1..n]) +setConsequent(para: Clause) +setConjunction(para: Conjunction)
Population
<<Class>>
-individuals: Individual[1..n]
-bestFit: Chromosome -size: Integer
+Population(size:Integer,initialized:Boolean) +getIndividuals(): Individual
+getFittest(): Integer +getSize():Integer
+setMembersl(para: Chromosome)
+saveIndividual(index: Integer, Individual ind)
Figure 3.19: Cognitive Radio and Population Class Diagrams
FitnessCalculator
<<Class>>
-solution: Byte
+setSolution( para:Byte[ ]) +setSolution(para: String[ ]) +getFitness():Integer
+getMaxFitness(): Integer Algorithm
<<Class>>
-uniformRate: Double -mutationRate: Double -tournamentSize: Integer -elitism: Boolean
+evovlePopulation( para: Population)
+crossOver(para1:Individual,para2:Individual): Individual +mutate(para: Population)
+tournamentSelection(pop:Population)
Figure 3.20: Algorithm and Fitness Calculator Class Diagrams
105
Iterator
<<Class>>
-index: Integer +getIndex()Integer
+setIndex(param:Integer) Iterate(para:Object)
Java.lang.Iterator
<<Class>>
Figure 3.21: Iterator Class Diagram
Connection
<<Class>>
-conString: String -user: User
-host: String -database: String +getConString(): String +getUser(): User
+getHost(): String +getDatabase(): String +setUser(param: User) +setconString(param: String) +setHost(param: String) +setDatabase(param: String) +connect(conString): Boolean
Figure 3.22: Connection Class Diagram
106
Condition
Clause
RuleVariable Variable
Rule
Conjuction KnowledgeBase
InterfaceEngine Scanner Simulator
Optimizer Individual
Alogrithm
DataBase AntecedentClause
GeneticAlgorithm
Population Sensor
ConsequentClause
CognitiveRadio
Figure 3.23: Class Interaction Diagram in the new system
107
3.5.2 Advantages of the New System