Chapter 4 Research design and methods
4.21 Ensuring internal and external validity
A data dictionary, or data repository, is a central storehouse of information about the system’s data. The main purpose of a data dictionary is to describe, document and organize facts about the system and the database. The data dictionary for the system is illustrated in table 4.11
Table 4.11: The Data Dictionary for the TvWSOUGA System S/N VARIABLE DESCRIPTION
1 jta A Java Swing Text Area Component. This component is used to display the out put of the genetic algorithm,ga, object.
2 jbtn A Java Swing Button Component used to refresh the genetic algorithm object.
3 jbtnclose A Java Swing Button Component used to clear the text display area.
4 BEGIN A primitive variable of type long used to flag the beginning of execution of the genetic algorithm object.
5 population A linked list object of the Candidate class. It is used to hold a list of Candidate Objects that form our genetic algorithm population.
6 jsp A Java Swing Scroll Pane used to add scrolling effects and scroll bars to the jta JTextArea object.
7 ap AnalysisPanel object used to display current location.
8 P1 A Java Swing Panel Object used to hold the jsp and p2 objects in the application display window.
9 p2 A Java Swing Panel object used to hold jbtn and the jbtnclose objects in the application display window.
10 plot A SineFrame object used to plot and display the amplitude of the frequency
11 p4 A Java Swing Panel object used to hold and display the SineFrame object, plot in the application
12 scanner A RadarPane object used to display the signal scanner.
13 model A LoadJTableData Abstract Table Model object used to populate the table object.
14 table A JTable object used to hold and display tabular information retrieved from the database.
150 S/N VARIABLE DESCRIPTION
15 p3 A JPanel object used to hold the panel object that contains our tabular data.
16 panel A JPanel object used hold the table object.
17 C1,c2,c3,c4,w1,w2,c hild1,child2
Objects of the Candidate Class used to generate next generations viable bit strings or genes.
18 Childs An array of Candidate class that contains children/ Childs generated in the next generation.
19 f1,f2, f3 and f4 Fitness of c1,c2,c3 and c4 respectively.
20 m1 and m2 Boolean flags used to determine whether to mutate child1 or child2
21 isChild1Good, Boolean flag used determine if the fitness of child1 is higher than the fitness of any other arbitrary child, say w1, taken from the population sample for comparison.
22 isChild2Good Boolean flag used determine if the fitness of child2 is higher than the fitness of any other arbitrary child, say w2, taken from the population sample for comparison.
23 ga An object Genetic Algorithm class that holds and displays all the applications processing and output.
24 maxStep A constant that holds the number of times selection,
crossover and mutation will take place in a given population and produce the next generation until the generation.
25 count An integer counter variable used to count the number of times selection, crossover, mutation and production of the next generation has occurred.
26 print() This a method of the GA class used to display output
27 run() A method of the GA class used call an object of the GA class to action.
28 ProduceNextGenerati on()
Is a method of the GA class used by ga object to select, crossover, mutate and generate next generation of genes with desired fitness.
29 newChild(Candidate c1, Candidate c2)
A method of the GA class used by ga objects to perform crossover
30 Mutate (Candidate c) This method of the GA class is used to mutate a Candidate gene or solution.
31 main(String[] args) The main method of the GA class is used to instantiate a ga object and invoke its run() method.
32 GA() Constructor of the GA class
151 S/N VARIABLE DESCRIPTION
33 Candidate() Constructor of the Candidate class.
34 random() The random() method of the Candidate class is used to generate/ assign random genotype.
35 gene() The gene method of the Candidate Class is used build binary genes
36 fitness() As the name suggests, the fitness() method of the Candidate class is used to calculate the fitness of each gene in the population for selection
37 compareTo() This method is used to compare the fitness of two Candidate objects for best fit. It returns 1 if the current Candidate' fitness is less than fitness of the supplied Candidate, -1 if the fitness of the current Candidate is greater than the fitness of the supplied Candidate and 0 is equal.
38 toString() This method of the Candidate class is used to display binary gene and the gene's fitness . It returns a String
Table 4.12: The Data Dictionary for the TVWSOUGA Database
S/N FIELD NAMES
FIELD TYPES FIELD
SIZE
CONSTRAINT DESCRIPTION
1 ID Number Primary Key Serial number of rules
2 Rule_id VARCHAR 10 Not Null A unique id given to a
rule
3 Clause_id VARCHAR 10 Foreign key
Referenced
Used to reference foreign keys 4 conjunction Enum(‘AND’,’OR’,’I
MPLICATION’)
10 Not Null Used to combine clauses in a rule
6 Rule_variablei d
VARCHAR 10 Primary Key This is part of the clause used in the inference rule
7 condition Enum(‘AND’,’OR’,’I MPLICATION’)
10 Not Null This is used to describe the conditions in the inference engine
152 S/N FIELD
NAMES
FIELD TYPES FIELD
SIZE
CONSTRAINT DESCRIPTION 8 Clause_type Enum(‘ANTECEDE
NT’,’CONSEQUEN T’)
10 Not Null This is part of the rules in the inference engine eg channel 25 is adjacent to channel 24 9 Clause_value VARCHAR 20 Not Null This also part of the
clause used in the inference rule
10 Freq_band VARCHAR 7 Not Null This is used to represent the frequency band 11 Location VARCHAR 5 Not Null This is used to describe
the channel location
12 CR_id VARCHAR 6 Not Null This is used to describe
the CR identification location
13 DBC Enum(‘0’,’1’) ENUM Not Null This is used to describe the Database Channel 14 PIB Enum(‘0’,’1’) ENUM Not Null This is the Power in
Band
15 POOB Enum(‘0’,’1’) ENUM Not Null This is the Power out of Band
16 CNR Enum(‘0’,’1’) ENUM Not Null This is used to describe the Carrier Noise Ratio 17 PR Enum(‘0’,’1’) ENUM Not Null This used to describe the
protection ratio
18 EL Enum(‘0’,’1’) ENUM Not Null This is used to describe the Emission Limit of the transmitter
18 DBSS Enum(‘0’,’1’) ENUM Not Null This used to describe the Database Subscriber Station
19 CRUE Enum(‘0’,’1’) ENUM Not Null This is the Cognitive Radio user Equipment
153 S/N FIELD
NAMES
FIELD TYPES FIELD
SIZE
CONSTRAINT DESCRIPTION 20 CRLocation Enum(‘0’,’1’) ENUM Not Null This stores the cognitive
location
21 Adjacent_CR Enum(‘0’,’1’) ENUM Not Null This stores the CR that is near to the CR we are considering for allocation
22 Adjacent_CR_D irecti
Enum(‘N’ ‘W’ ‘E’
‘NE’‘NW’ ‘SE’ ‘SW’
ENUM Not Null This sores the direction of adjacent CR