selection

Differences between roulette wheel selection and rank based selection

我与影子孤独终老i 提交于 2019-12-10 20:57:11
问题 what are the differences between roulette wheel selection and rank based selection in genetic algorithm. i am confused which one is best for me now. that's why just want to know the differences. 回答1: The Rank Based Selection algorithm assigns probability(of them getting selected) to the items according to the priority they have. For example, the least priority item might get 10%, the one above that 20% and so on. In other words, the probability of an item getting selected is modified, and is

Disable JList Cell Selection Property

流过昼夜 提交于 2019-12-10 18:35:15
问题 I am attempting to display an array of strings in a JList , which is then added to a JPanel using Java Swing . I am not having a problem displaying the data in the Jlists , however I would like to remove the default property that allows a user to select items in the Jlist . I am attempting to simply display the data to the user. Unfortunately I am unable to locate the property that would allow me to disable this feature. A example of the selection property that I am referring to can be seen

Select n rows after specific number

纵饮孤独 提交于 2019-12-10 18:07:17
问题 I work with a data.frame like this: Country Date balance_of_payment business_confidence_indicator consumer_confidence_indicator CPI Crisis_IMF 1 Australia 1980-01-01 -0.87 100.215 99.780 25.4 0 2 Australia 1980-04-01 -1.62 100.061 99.746 26.2 0 3 Australia 1980-07-01 -3.70 100.599 100.049 26.6 0 4 Australia 1980-10-01 -3.13 100.597 100.735 27.2 0 5 Australia 1981-01-01 -2.73 101.149 101.016 27.8 0 6 Australia 1981-04-01 -4.11 100.936 100.150 28.4 0 I want to create a summary statistic with

Genetic Algorithm roulette wheel selection

烂漫一生 提交于 2019-12-10 17:46:00
问题 I am having issues understanding the algorithm. Here is the most popular one seen online 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

How to modify SELECT tag's default highlight behaviour in IE and Opera?

两盒软妹~` 提交于 2019-12-10 17:31:35
问题 Here is my HTML: <select style="background-color:#e0f0f1"> <option selected="selected">Select</option> <option class="" value="one">One</option> <option class="" value="two">Two</option> </select> See this code in action In IE and Opera, when you select an option, it is highlighted with a blue background colour. Firefox, Chrome and Safari don't do this. Is there a way or trick to remove that blue highlight when the option is selected so that the original background colour is always shown? If

Delphi - Get the whole word where the caret is in a memo

痞子三分冷 提交于 2019-12-10 17:28:51
问题 I need to be able to select the whole word of a TMemo if the caret is directly adjacent or in a word in the memo. Consider the following (where | is a caret) Here is some text| = Select text Here is so|me text = Select some |Here is some text = Select Here Here is some text | = Select '' 回答1: Check this code with comments to explain how works. function SelectWordUnderCaret(AMemo:TMemo):string; var Line : Integer; Column : Integer; LineText: string; InitPos : Integer; EndPos : Integer; begin /

swt table change selection item color

人走茶凉 提交于 2019-12-10 16:19:14
问题 I'm using a standard swt table which, as you may know, by default when an item is selected is colored blue (windows standard). When the selection is inactive, it turns light gray. I would like to override both colors... I've searched all over the web but could only find some very old code which no longer seems to work with the table widget. Below is some sample code I was trying to overwrite the default color but it doesn't seem to be working (please excuse the dirty code, was just trying to

Way to obtain the word cursor is on, in WPF RichTextBox Control

一笑奈何 提交于 2019-12-10 16:13:32
问题 I would like to know how I can get the word that current cursor is on, in WPF RichTextBox. I am aware that RichTextBox has Selection Property. However, this only gives me the text that is highlighted in the RichTextBox. Instead I would like to know the word the cursor is on even if the whole word is not highlighted. Any tips are appreciated. Thank you very much. 回答1: Attach this function to an arbitrary RichTextBox, now called testRTB, and see Output window for results: private void testRTB

Disable WPF TreeView (or TreeViewItem) selection?

吃可爱长大的小学妹 提交于 2019-12-10 16:12:35
问题 Is there a nice way (except retemplating the whole TreeViewItem.Template ) to disable selection in TreeView ? I am basically looking for the ItemsControl style of the TreeView (An ItemsControl is the best use to 'disable' selection on ListBox , read this post) 回答1: Whenever an item is selected, you could "unselect" it. Ex. modify the code from http://www.codeproject.com/KB/WPF/TreeView_SelectionWPF.aspx or use a MVVM approach (see http://www.codeproject.com/KB/WPF/TreeViewWithViewModel.aspx)

ListView FocusedItem Becomes NULL

与世无争的帅哥 提交于 2019-12-10 15:22:27
问题 When the program runs, there is a series of ListView forms. We populated one of them with items (as strings) and we check whether the state of selection has changed. Once it's changed, we grab the text of the selected item using FocusedItem.Text. The first time works just fine but when another selection is made, the selected item returns as null. The only way we can temporarily get around this issue is to clear and repopulate the form. The disadvantage is that we lose the highlighted item.