Page 1 of 1

How do I compile and use RandomAgar?

PostPosted: March 11th, 2015, 9:18 pm
by glider_rider

I want to be able to use RandomAgar. How do I compile and use it? Thanks in advance for any help.

Re: How do I compile and use RandomAgar?

PostPosted: March 12th, 2015, 8:46 am
by Scorbie
Before I start, there's a Windows executable version of RandomAgar called RandAgar by Nicolay Beluchenko, available here.

RandomAgar is a C++ program so you would need to install a cpp compiler to compile it. I'm no expert at explaining all the petty details about installing the compiler stuff... But I'm pretty sure an IDE like CodeBlocks or Dev-cpp would work nice and fine. (for windows. AFAIK, GCC is preinstalled at linux and probably mac too... or isn't it?)

Anyway, You can get my modified version of RandomAgar Here (in the "Original" folder. Go to the "Hack" folder for the hacked version with xmin, ymin params).
It is more convenient since it outputs results as rle.

There's readme.htm for the original manual.

If you use my hacked version, you can compile it automatically with compile.bat
or else, typing this in the command line would probably work fine.

for randomagar:
g++ -O3 -march=native -o Randomagar RLEdoer.h RanMar.cpp RanMar.h field.h main.cpp symm.cpp symm.h

for recover:
g++ -O3 -march=native -o recover RLEdoer.h RanMar.cpp RanMar.h field.h recoverMain.cpp symm.cpp symm.h

(note: I know nothing about gcc compiling options! Some advice is welcome...)

Re: How do I compile and use RandomAgar?

PostPosted: March 12th, 2015, 9:11 am
by Scorbie
Now to use randomagar:
You need to tweak the variables in the source code and recompile every time to change the params.
I really wish if someone could change this...

At field.h, line 14, there are variables XMAX, YMAX (and possibly XMIN and YMIN if you use Hacked version)
These determine the maximum size of the grid. (The size may differ by different symmetries)

At main.cpp, the const variables in the front are the settings that you would like to change.
I added the param ignoredperiods which ignores periods in the const int array.

And here is the explanation at readme.htm:
Modifying the program

There are some global parameters you can adjust in the code:
  • Field's XMAX and YMAX dictate the maximum size of the field.
  • Field's fixed_p is the period that step() detects when it steps the pattern. The value is set to 2, and there's probably no much point in changing it.
  • randomizeField() is set to generate random initial patterns with density 1/3. If you want, you can change the density.
  • maxsymms is the number of symmetry configurations that the program tries. If set to zero, the program runs forever.
  • fieldspersymm is the number of random patterns tried for each symmetry configuration. For efficiency, this value shouldn't be too low, because each change of symmetry involves a call to buildnet(), which is time-consuming.
  • If filterStringy is set to true, the program rejects patterns that are completely made of orthogonal or diagonal lines. These patterns are very common and quite boring.
  • filterConstPop is intended to filter out patterns that consist of gliders with still-lifes and blinkers, which are also very common. If it's set to true, the program rejects patterns that have constant population, if their period is at least 10. However, this also filters out other patterns
  • The program also rejects patterns with period smaller than minperiod.
  • Finally, the CA rules can be changed in Field's CArule array.

And to use recover:
recover is a program for recovering the original soup that made the pattern you're interested at. Put the recover at the same directory as the result rle file and execute it (at the command line, I think) type the filename of the result rle file and the original soup would come out.

Re: How do I compile and use RandomAgar?

PostPosted: March 12th, 2015, 9:15 am
by Scorbie
Post a reply when anybody has questions/troubleshooting. I hope anyone in the forum would help.
I know that my explanation is not that thorough but I was in sort of a rush.
Any comments and decyphering Scorbian is thankful.

Re: How do I compile and use RandomAgar?

PostPosted: March 12th, 2015, 11:27 am
by glider_rider
Hmm... For some reason, the commands you've given for compiling don't work. How do I run compile.bat?

EDIT: Never mind, I got it. Thanks!