Updates and Results
Talks and Posters
Advice
Ideas
Important Figures
Write-Ups
Outreach
How-To
Funding Opportunities
GENETIS
GENETIS
Draft saved at 00:00:00
Fields marked with
*
are required
Entry time:
Wed Nov 20 15:05:14 2019
Author
*
:
Subject
*
:
<p>​Today I spent some time looking at task 1 from the update here: <a href="http://radiorm.physics.ohio-state.edu/elog/GENETIS/20">http://radiorm.physics.ohio-state.edu/elog/GENETIS/20</a>. Below are my updates. </p> <p> </p> <h3><u><strong>Task-- Fix error at fitness function</strong></u><strong>: </strong></h3> <p>Currently, the loop stops at the fitness function calculation, and aborts (program fitnessFunction_ARA.cpp). The following are the things I have tried.</p> <p><strong>1.<u><em>Run this outside of the loop:</em></u> </strong>Julie and Alex did this 11/19/19. It gave a segmentation fault. <em><u>UPDATE: HERE'S WHAT I DID TO CHECK THIS TODAY:</u></em></p> <p><em>(a) Checked using cout:</em> I used some cout commands to print sections looking for errors. It seems we were not properly giving it arguments when running it outside of the loop. Since it's running outside of the loop, these variables are not initialized. Thus, to run you need to type: ./fitnessFunction.exe $NPOP $AraOut_i.txt</p> <ul> <li>For example: ./fitnessFunction.exe 1 AraOut_1.txt</li> </ul> <p><em><u>Status: The output file is verified!</u></em> Running this way <u>does</u> properly generate our output file named fitnessScore.csv. I've double-checked this file, and it is properly being filled. At the moment it is giving a Veff of 0, thus no valid fitness score; however, this should be fixed automatically once we get real outputs from AraSim without a Veff of 0. </p> <p> </p> <p><strong> 2. <u><em>Check file location:</em></u></strong> See if fitnessScore.csv is being located in the correct place when the genetic algorithm initializes the next generation. </p> <p><em>(a) Searched bash script for the final location of fitnessScores.cvs: </em></p> <p>In lines 298, 299 of the bash script, it is doing the following </p> <blockquote> <p>cp fitnessScores.csv "$WorkingDir"/Run_Outputs/$RunName/0_fitnessScores.csv</p> <p>mv fitnessScores.csv "$WorkingDir"</p> </blockquote> <p>This is taking the .csv output generated from fitnessFunction_ARA.cpp, and is moving it to the run name directory and renaming it based on the generation -- ie first gen is 0_fitnessScores.csv-- so that data isn't overwritten. Then, for some reason, it moves the original copy -- ie fitnessScores.csv-- to the location /fs/project/PAS0654/BiconeEvolutionOSC/BiconeEvolution/current_antenna_evo_build/XF_Loop/Evolutionary_Loop</p> <p>In line 374 we then run our genetic algorithm again. </p> <blockquote> <p>./roulette_algorithm.exe cont $NPOP</p> </blockquote> <p>This does not seem to take in the input file as an argument.</p> <p> </p> <p><em>(b) Checked roulette_algorithm.cpp for the location it accesses fitnessScores.csv: </em></p> <p>I checked if it was hard-coded into the roulette_algorithm.cpp script. I found the following lines.</p> <blockquote> <p> // Now we need to read the fitness scores: </p> <p> ifstream fitnessScores;</p> <p> fitnessScores.open("fitnessScores.csv");</p> <p> string fitnessRead[NPOP+2];</p> <p> for(int i=0;i<(NPOP+2);i++)</p> <p> {</p> <p> getline(fitnessScores,fitnessRead[i]);</p> <p> if(i>=2)</p> <p> {</p> <p> fitness[i-2] = atof(fitnessRead[i].c_str());</p> <p> if (fitness[i-2]<0)</p> <p> {</p> <p> fitness[i-2] = 0; // If the fitness score is less than 0, we set it to 0 to not throw things off. </p> <p> }</p> <p> }</p> <p> }</p> <p> fitnessScores.close();</p> <p>}</p> </blockquote> <p>This means that our script roulette_algorithm.cpp is grabbing the fitnessScores.csv from its current directory-- which is accurate due to the line (mv fitnessScores.csv "$WorkingDir") referenced above in the bash script. <span style="background-color:#FFFF00">Something we could verify here is to make sure this function is properly working by having it cout elements from the fitnessScores.csv within this function and to run the roulette algorithm separately. We could do this now, however, we don't have real outputs in fitnessScores.csv anyway, since we are getting a veff=0 for AraSim temporarily. </span></p> <p>In the meantime, I've added the following line after section E (the section that runs fitnessFunction_ARA.cpp, and generates/moves/copies fitnessScore.csv):</p> <blockquote> <p>echo 'Congrats on getting a fitness score!'</p> </blockquote> <p>This should check to be sure that it runs until after this point. I've also added the following line after section E (section that plots the fitness score versus gen):</p> <blockquote> <p>echo 'Congrats on getting some nice plots!'</p> </blockquote> <p>This should check to be sure that it runs until after this point. Note that I have added these lines to both our original bash script, and the one Alex M. is editing to turn every section into a function. I have added these lines to the .sh scripts containing the functions to be sure the function scripts for these tasks ran completely. <em><u>Once we have real AraSim outputs, we should be able to create some cout lines in the instructions highlighted in yellow above. </u></em></p> <p> </p> <p><strong>3. <u><em>Look at how it's calculating the fitness score.</em></u></strong></p> <p>I have not checked this yet. However, I do not think it is likely this is the issue. I will check later though. </p>
Encoding
:
HTML
ELCode
plain
Suppress Email notification
Resubmit as new entry
Attachment 1:
Drop attachments here...
Draft saved at 00:00:00
ELOG V3.1.5-fc6679b