Implemented BFS, DFS and A* To compile this project, use the following command: g++ -o search main.cpp Then you can run it: ./search The input is loaded from a input file in.txt Here is the format of the input file: The first line of the input file shoud contain two chars indicate the source and destination city for breadth first and depth first algorithm. The second line of input file shoud be an integer m indicate the number of connections for the map. Following m lines describe the map, each line represents to one connection in this form: dist city1 city2, which means there is a connection between city1 and city2 with the distance dist. The following input are for A* The following line contains two chars indicate the source and destination city for A* algorithm. Then there is an integer h indicate the number of heuristic. The following h lines is in the form: city dist which means the straight-line distance from the city to B is dist.
標簽: Implemented following compile command
上傳時間: 2014-01-01
上傳用戶:lhc9102
* CONSTRAINTS * This module does not handle data which is considered out of range by the * application(i.e. fixed constants which represent error condition) * * Maximum weight value must be limited to 128 to prevent an overflow * condition during the calculation. * * The internal data type must be large enough to handle the calculations. * The maximum possible internal value * = Max Input Value * (weight - 1) + Max Input Value * If a maximum weight of 128 is used, the internal data type should be 2 * times the size of the input data type.
標簽: CONSTRAINTS considered module handle
上傳時間: 2015-09-07
上傳用戶:qunquan
本程序分為界面和控制器核心兩部分 一、界面部分功能主要有: (1)顯示控制器核心數據和參數 (2)與用戶交互,可以調節初始輸入溫度值,并將溫度變化率清零以便進行新一輪的模擬。 界面使用了定時器。開啟模擬時候,每隔一秒,觸發一次計時器消息,完成下列工作: 1. 將界面上的當前溫度映射為模糊控制器的輸入溫度 2. 輸出當前溫度,當前溫度變化率 3. 調用模糊控制,得到控制器輸出值,將其乘以m_fFuelEffect (燃料輸出對溫度變化率的影響率,目前設置為0.3),得到變化率的變化,加到當前溫度變化率上,得到新的變化率。 4. 更新變化率,更新溫度。將結果映射到界面上。 5. 記錄相關數據并以圖形、數字方式輸出。 二、控制器核心用到的類有 (1)Rule_Func_Single 將簡單的函數包裝成類,方便后面使用。實現了 NB, NS, ZO, PS, PB 等梯形函數,以及常值函數。 (2)Grading_Func 繼承自Rule_Func_Single類,比基類增加一個輸入參數,指明梯形函數屬于Input, Delta或者Output 。 (3)Rule_Function 將兩個Grading_Func結合在一起,進行模糊與或模糊或等模糊邏輯操作,并輸出結果。
上傳時間: 2014-11-01
上傳用戶:Yukiseop
(1) This pin may function as either a JTAG port or a user I/O pin. If the device is configured to use the JTAG ports for in-system programming, this pin is not available as a user I/O pin. (2) The user I/O pin count includes dedicated input pins and all I/O pins.
標簽: configured pin function either
上傳時間: 2014-01-27
上傳用戶:qwe1234
一個簡單的SPI?。桑泻耍琒PI Core Specifications 可以從說明文檔中找到! The simple Serial Peripheral Interface core is an enhanced version of the Serial Peripheral Interface found on Motorola s M68HC11 family of CPUs. The Serial Peripheral Interface is a serial, synchronous communication protocol that requires a minimum of 3 wires. FEATURES: · Compatible with Motorola’s SPI specifications · Enhanced M68HC11 Serial Peripheral Interface · 4 entries deep read FIFO · 4 entries deep write FIFO · Interrupt generation after 1, 2, 3, or 4 transferred bytes · 8 bit WISHBONE RevB.3 Classic interface · Operates from a wide range of input clock frequencies · Static synchronous design · Fully synthesizable
標簽:
上傳時間: 2015-09-17
上傳用戶:TRIFCT
this m file can Find a (near) optimal solution to the Traveling Salesman Problem (TSP) by setting up a Genetic Algorithm (GA) to search for the shortest path (least distance needed to travel to each city exactly once) Notes: 1. Input error checking included 2. Inputs can be specified in any order, so long as the parameter pairs are specified as a parameter , value
標簽: Traveling Salesman solution Problem
上傳時間: 2013-12-22
上傳用戶:ruixue198909
This code was used for making the practical measurements in section 2.3 of my thesis. This Matlab code allows an OFDM signal to be generated based on an input data file. The data can be random data, a grey scale image, a wave file, or any type of file. The generated OFDM signal is stored as a windows wave file, allowing it to be viewed, listened to and manipulated in other programs. The modified wave file can then be decoded by the receiver software to extract the original data. This code was developed for the experiments that I performed in my honours thesis, and thus has not been fully debugged. This is the original code developed for the thesis and so has several problems with it. The BER performance given by the simulations is infact Symbol Error Rate.
標簽: This measurements practical section
上傳時間: 2015-09-20
上傳用戶:tedo811
This software designs the document management system may replace the tedious low effect the manual management, has used the c language programming, realized the document input to loan, the information management and the data compilation three big cores function
標簽: the management software document
上傳時間: 2013-12-20
上傳用戶:yt1993410
Preparation of a function, even to the importation of n, the function call seeking +1/n 1/2+1/4+ .... When n is odd input, the function call 1/1+1/3+ ... +1/n (using function pointer)
標簽: function Preparation importation the
上傳時間: 2014-01-21
上傳用戶:semi1981
We often get questions about how the deflate() and inflate() functions should be used. Users wonder when they should provide more input, when they should use more output, what to do with a Z_BUF_ERROR, how to make sure the process terminates properly, and so on. So for those who have read zlib.h (a few times), and would like further edification, below is an annotated example in C of simple routines to compress and decompress from an input file to an output file using deflate() and inflate() respectively. The annotations are interspersed between lines of the code. So please read between the lines. We hope this helps explain some of the intricacies of zlib.
標簽: functions questions deflate inflate
上傳時間: 2014-01-02
上傳用戶:zhuyibin