abc-master
|
Go to the source code of this file.
Macros | |
#define | STOREDD(i, j) storedd[(i)*(numvars+1)+(j)] |
Functions | |
static int | make_random (DdManager *table, int lower) |
static int | sift_up (DdManager *table, int x, int x_low) |
static int | build_dd (DdManager *table, int num, int lower, int upper) |
static int | largest (void) |
static int | rand_int (int a) |
static int | array_hash (const char *array, int modulus) |
static int | array_compare (const char *array1, const char *array2) |
static int | find_best (void) |
static int | PMX (int maxvar) |
static int | roulette (int *p1, int *p2) |
int | cuddGa (DdManager *table, int lower, int upper) |
Variables | |
static ABC_NAMESPACE_IMPL_START char rcsid[] | DD_UNUSED = "$Id: cuddGenetic.c,v 1.28 2004/08/13 18:04:48 fabio Exp $" |
static int | popsize |
static int | numvars |
static int * | storedd |
static st__table * | computed |
static int * | repeat |
static int | large |
static int | result |
static int | cross |
Definition at line 135 of file cuddGenetic.c.
Function********************************************************************
Synopsis [Comparison function for the computed table.]
Description [Comparison function for the computed table. Returns 0 if the two arrays are equal; 1 otherwise.]
SideEffects [None]
SeeAlso []
Definition at line 706 of file cuddGenetic.c.
|
static |
Function********************************************************************
Synopsis [Hash function for the computed table.]
Description [Hash function for the computed table. Returns the bucket number.]
SideEffects [None]
SeeAlso []
Definition at line 674 of file cuddGenetic.c.
|
static |
Function********************************************************************
Synopsis [Builds a DD from a given order.]
Description [Builds a DD from a given order. This procedure also sifts the final order and inserts into the array the size in nodes of the result. Returns 1 if successful; 0 otherwise.]
SideEffects [None]
SeeAlso []
Definition at line 553 of file cuddGenetic.c.
int cuddGa | ( | DdManager * | table, |
int | lower, | ||
int | upper | ||
) |
AutomaticEnd Function********************************************************************
Synopsis [Genetic algorithm for DD reordering.]
Description [Genetic algorithm for DD reordering. The two children of a crossover will be stored in storedd[popsize] and storedd[popsize+1] — the last two slots in the storedd array. (This will make comparisons and replacement easy.) Returns 1 in case of success; 0 otherwise.]
SideEffects [None]
SeeAlso []
Definition at line 192 of file cuddGenetic.c.
|
static |
Function********************************************************************
Synopsis [Returns the index of the fittest individual.]
Description []
SideEffects [None]
SeeAlso []
Definition at line 736 of file cuddGenetic.c.
|
static |
Function********************************************************************
Synopsis [Finds the largest DD in the population.]
Description [Finds the largest DD in the population. If an order is repeated, it avoids choosing the copy that is in the computed table (it has repeat[i] > 1).]
SideEffects [None]
SeeAlso []
Definition at line 624 of file cuddGenetic.c.
|
static |
AutomaticStart
Function********************************************************************
Synopsis [Generates the random sequences for the initial population.]
Description [Generates the random sequences for the initial population. The sequences are permutations of the indices between lower and upper in the current order.]
SideEffects [None]
SeeAlso []
Definition at line 449 of file cuddGenetic.c.
|
static |
Function********************************************************************
Synopsis [Returns the average fitness of the population.]
Description []
SideEffects [None]
SeeAlso [] Function********************************************************************
Synopsis [Performs the crossover between two parents.]
Description [Performs the crossover between two randomly chosen parents, and creates two children, x1 and x2. Uses the Partially Matched Crossover operator.]
SideEffects [None]
SeeAlso []
Definition at line 794 of file cuddGenetic.c.
|
static |
Function********************************************************************
Synopsis [Generates a random number between 0 and the integer a.]
Description []
SideEffects [None]
SeeAlso []
Definition at line 653 of file cuddGenetic.c.
|
static |
Function********************************************************************
Synopsis [Selects two parents with the roulette wheel method.]
Description [Selects two distinct parents with the roulette wheel method.]
SideEffects [The indices of the selected parents are returned as side effects.]
SeeAlso []
Definition at line 914 of file cuddGenetic.c.
|
static |
Function********************************************************************
Synopsis [Moves one variable up.]
Description [Takes a variable from position x and sifts it up to position x_low; x_low should be less than x. Returns 1 if successful; 0 otherwise]
SideEffects [None]
SeeAlso []
Definition at line 517 of file cuddGenetic.c.
|
static |
Definition at line 121 of file cuddGenetic.c.
|
static |
Definition at line 126 of file cuddGenetic.c.
|
static |
CFile***********************************************************************
FileName [cuddGenetic.c]
PackageName [cudd]
Synopsis [Genetic algorithm for variable reordering.]
Description [Internal procedures included in this file:
Static procedures included in this module:
The genetic algorithm implemented here is as follows. We start with the current DD order. We sift this order and use this as the reference DD. We only keep 1 DD around for the entire process and simply rearrange the order of this DD, storing the various orders and their corresponding DD sizes. We generate more random orders to build an initial population. This initial population is 3 times the number of variables, with a maximum of 120. Each random order is built (from the reference DD) and its size stored. Each random order is also sifted to keep the DD sizes fairly small. Then a crossover is performed between two orders (picked randomly) and the two resulting DDs are built and sifted. For each new order, if its size is smaller than any DD in the population, it is inserted into the population and the DD with the largest number of nodes is thrown out. The crossover process happens up to 50 times, and at this point the DD in the population with the smallest size is chosen as the result. This DD must then be built from the reference DD.]
SeeAlso []
Author [Curt Musfeldt, Alan Shuler, Fabio Somenzi]
Copyright [Copyright (c) 1995-2004, Regents of the University of Colorado
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the University of Colorado nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.]
Definition at line 107 of file cuddGenetic.c.
|
static |
Definition at line 123 of file cuddGenetic.c.
|
static |
Definition at line 111 of file cuddGenetic.c.
|
static |
Definition at line 110 of file cuddGenetic.c.
|
static |
Definition at line 122 of file cuddGenetic.c.
|
static |
Definition at line 125 of file cuddGenetic.c.
|
static |
Definition at line 120 of file cuddGenetic.c.