ConwayLife.com - A community for Conway's Game of Life and related cellular automata
Home  •  LifeWiki  •  Forums  •  Download Golly

JavaLifeSearch

For scripts to aid with computation or simulation in cellular automata.

JavaLifeSearch

Postby Kasuha » November 9th, 2012, 2:08 pm

Seeing WLS has a thread here I guess I could post a link to JLS as well ... also for people who can't see what's posted on the mailgroup. Perhaps someone might be interested...

Link: JavaLifeSearch v1.7
Manual: JLS manual

You need Java 6 or 7 to run it. In Windows 7 I can simply click on the jar file to run it, but on some other systems you may need to use a command-line command like this:

java -jar JavaLifeSearch_1.7.jar


It is similar to WLS in many factors as it was inspired by WLS in the first place. Its main objective are searches for low-period oscillators and sparkers but it can be used also to find stable eaters and other support for aperiodic or long-period reactions.
It is probably slower (in search) than WLS but I believe it provides better comfort in setting up the search and has many features WLS doesn't have. And of course it is multiplatform thanks to Java.
Last edited by Kasuha on January 13th, 2013, 3:58 am, edited 9 times in total.
Kasuha
 
Posts: 54
Joined: November 1st, 2012, 11:39 am

Re: JavaLifeSearch

Postby EricG » November 9th, 2012, 6:42 pm

Fantastic. Thanks. As a Mac user, I really appreciate this.

Also: Mail group? I saw evidence of an old one in the files on the Just Friends rule, but I didn't know there is a current mailing list. Is it open to new (very well behaved) members?
EricG
 
Posts: 199
Joined: August 19th, 2011, 5:41 pm
Location: Chicago-area, USA

Re: JavaLifeSearch

Postby Kasuha » November 11th, 2012, 3:51 am

New version - fix of an error in active cell constraints, fix of ancient annoyance in editing (hopefully not creating a new one), and added option to have "outer space" cells OFF rather than unset, which is now default (not as easy as it may seem as some outer cells still have to stay unset). I have edited the first post to point at the new version.

EricG wrote:Also: Mail group? I saw evidence of an old one in the files on the Just Friends rule, but I didn't know there is a current mailing list. Is it open to new (very well behaved) members?


It is not very active and I'm not even sure who can add new members, maybe you can try to ask Jason Summers. I'm just a lurker for many years already.
Kasuha
 
Posts: 54
Joined: November 1st, 2012, 11:39 am

Re: JavaLifeSearch

Postby Kasuha » November 11th, 2012, 1:15 pm

It's always pretty embarrassing to make a release, then find a bug in it the same day. That's mainly caused by the fact that I'm too lazy to do thorough testing before the release but I'm afraid not much can be done with that.

Version 1.2 does not stop applying rules when it encounters an error (such as glider running into the edge).
Plus I added handling Home/End keys which bring you to first/last generation and on second press they take you back to the generation where you were before. I find it useful for playing with aperiodic stuff like herschel circuitry where I often need to change something in g0 and then check how it affected the evolution - so hopefully you will find it useful, too.
Kasuha
 
Posts: 54
Joined: November 1st, 2012, 11:39 am

Re: JavaLifeSearch

Postby David » November 14th, 2012, 7:19 am

Maybe you can consider using C++...

As original lifesrc used C.
Call me "Dannyu NDos" in Forum. Call me "Bag Sinhwan"(박신환) in Wiki.
David
 
Posts: 211
Joined: November 3rd, 2009, 2:47 am
Location: Daejeon, South Korea

Re: JavaLifeSearch

Postby Kasuha » November 14th, 2012, 10:09 am

David wrote:Maybe you can consider using C++...

As original lifesrc used C.

I did consider C++ and I have chosen Java for number of reasons. Some of them may not be applicable today but the project started 5 years ago and I picked it up again with intent to finish it, not to write it again.
If you're interested and want to give it a speed boost, you can write a native search engine for it. There's an internal API and the engine can communicate with the GUI through JNI. The downside of using native engine of course is that it will only run on one platform.
Kasuha
 
Posts: 54
Joined: November 1st, 2012, 11:39 am

Re: JavaLifeSearch

Postby Kasuha » November 15th, 2012, 3:08 am

Version 1.3 is available. New feature: undo/redo. It goes only to the level of cell setting, when you resize the board or load a pattern, undo history is cleared. Also the amount of cell changes stored in the undo stack is limited but I believe it is sufficient for all practical purposes.

I have also discovered an important bug which is there at least since version 1.0 (I didn't test beta releases): loading search progress saved with status file is broken, it looks fine after the file is loaded but when you continue the search it produces invalid results. I hope I'll have a fix for it soon but I have just discovered that and don't have time to look at it just now.
Kasuha
 
Posts: 54
Joined: November 1st, 2012, 11:39 am

Re: JavaLifeSearch

Postby Kasuha » November 15th, 2012, 4:11 pm

Version 1.4 is available (see first post in the topic), and the bug should be fixed now. Any previously saved files (from versions 1.0 or later) should be usable, problem was in loading code, not in the file contents.

I consider JLS feature complete now.
Kasuha
 
Posts: 54
Joined: November 1st, 2012, 11:39 am

Re: JavaLifeSearch

Postby Kasuha » November 18th, 2012, 4:41 am

I have created a preliminary version of user manual for JLS (see top post). I know it is not perfect or complete but writing documentation is not a lot of fun for me so I'd like to have some feedback, too. Proofreading comments and requests for improvements are welcome.
Kasuha
 
Posts: 54
Joined: November 1st, 2012, 11:39 am

Re: JavaLifeSearch

Postby Kasuha » November 21st, 2012, 5:12 pm

Version 1.5 and updated manual are out. Outer space cell handling was not really optimal e.g. for spaceship searches so I thought I should improve it. I've also changed strictly OFF outer space cell state to rule-based so it may now be ON or even alternating for rules with B0 (S8 means ON, no S8 means alternating).
Kasuha
 
Posts: 54
Joined: November 1st, 2012, 11:39 am

Re: JavaLifeSearch

Postby David » December 28th, 2012, 7:31 am

This program is faster than WLS! Thank you!

(Sorry, but this program becomes slower than WLS when I try to search complicated pattern, such as 2c/7 spaceship.)

But there is an annoying bug. When I try to search oscillators, still lives also are searched, and also sub-periodic oscillators... (i.e. Still lives and period 2 oscillators are searched when I try to search period 4 oscillators.)
Call me "Dannyu NDos" in Forum. Call me "Bag Sinhwan"(박신환) in Wiki.
David
 
Posts: 211
Joined: November 3rd, 2009, 2:47 am
Location: Daejeon, South Korea

Re: JavaLifeSearch

Postby Kasuha » December 28th, 2012, 4:39 pm

David wrote:(Sorry, but this program becomes slower than WLS when I try to search complicated pattern, such as 2c/7 spaceship.)

It's a Java application, so it's essentially an interpreted code. It cannot be ever faster than a compiled program, despite all the just-in-time compilations and other optimizations Sun/Oracle have invented and implemented to it.
It may be comparable with WLS or even faster when various kinds of symmetries are used as it is designed to optimize them and doesn't work on cells but on "variables".
On the other hand, it is portable and can be used "as is" on many platforms, plus it has features that AFAIK are not present in any other search program.

David wrote:But there is an annoying bug. When I try to search oscillators, still lives also are searched, and also sub-periodic oscillators... (i.e. Still lives and period 2 oscillators are searched when I try to search period 4 oscillators.)


Well... sorry but that's not a bug. If you start an unconstrained search, then if a stable pattern fits it, it's a valid solution too. If you don't want to see stable solutions, just define one cell which is not stable - set it to ON in generation 0 and OFF in generation 1. Then set up search sorting to start searching from that cell out (diamond expansion is probably the best for that purpose).
If you are looking for 100% volatile patterns then JLS unfortunately does not support setting up such constraint but it can be added if necessary. I did not want to add too many features which would turn out unused, for instance I had a "phoenix" constraint in for a brief period but then I removed it as I did not consider it useful or important enough to stay. It is not hard to add such constraints and they don't slow down the search significantly (when turned on; when constraint is not used it has zero impact), the problem is that it's possible to come up with hundreds of them and the question is which are useful enough to deserve being implemented and added to the GUI.
Kasuha
 
Posts: 54
Joined: November 1st, 2012, 11:39 am

Re: JavaLifeSearch

Postby David » December 28th, 2012, 8:04 pm

Kasuha wrote:Well... sorry but that's not a bug. If you start an unconstrained search, then if a stable pattern fits it, it's a valid solution too.

It must NOT be valid solution! This problem can be solved easily, however.
Kasuha wrote:If you don't want to see stable solutions, just define one cell which is not stable - set it to ON in generation 0 and OFF in generation 1. Then set up search sorting to start searching from that cell out (diamond expansion is probably the best for that purpose).

Maybe that is not a clever idea. This bug won't be fixed with setting a single cell.
And 'expansion' searching algorithm is great idea, but it isn't seen as expansion, but narrowing.
Kasuha wrote:If you are looking for 100% volatile patterns then JLS unfortunately does not support setting up such constraint but it can be added if necessary.

Maybe you should develop this program. The options are better than WLS!
Good luck!
Call me "Dannyu NDos" in Forum. Call me "Bag Sinhwan"(박신환) in Wiki.
David
 
Posts: 211
Joined: November 3rd, 2009, 2:47 am
Location: Daejeon, South Korea

Re: JavaLifeSearch

Postby Kasuha » December 29th, 2012, 8:37 am

Let me reiterate: it is not a bug. It works as intended and the fact that you don't like solutions which it produces does not make these solutions invalid. The problem is that either you are not clever enough to set up the search to avoid solutions you dislike, or there are not options which would allow you doing that, which could qualify as missing feature, not a bug.

Search sorting does not restrict or narrow the search. It only sets up the order in which cells will be set while searching for solution but in the end, the solution always consists of all initially Empty cells set either ON or OFF, whatever the order was. Correct sorting selection may significantly reduce time needed for the search. Click on Search/Options -> Sorting tab to see what I am talking about.

As far as I understand, you'd like to see something like negated "also find subperiods" setting from WLS because JLS behaves as if it had this setting always checked. I never had a problem with my searches without that option because I was usually searching for "tools" such as sparkers with certain spark shape or patterns supporting certain part of a reaction and subperiods, especially stable supports are actually welcome. But I may try to figure out a reasonable way how to add that option to JLS sometime in the future when I find time for it.
Kasuha
 
Posts: 54
Joined: November 1st, 2012, 11:39 am

Re: JavaLifeSearch

Postby Kasuha » January 4th, 2013, 1:05 pm

Version 1.6 is out.

I have discovered an ugly bug in JLS 1.5 - saved search progress lost track of which cells are unchecked and continuing the search after loading it from the file suddenly started searching also cells defined as unchecked.

Together with the fix, I also added option to reverse the sort order, allowing searching from outside towards a center which may be found useful e.g. to look for smallest solutions since JLS always tries OFF cells first.

And the second addition is an option to skip subperiodic solutions, using which the JLS may start skipping solutions similarly to how WLS does it by default. I'd suggest to use it with care, though, and it is off by default.

Manual is updated, too.

See the first post for updated links.
Kasuha
 
Posts: 54
Joined: November 1st, 2012, 11:39 am

Re: JavaLifeSearch

Postby David » January 12th, 2013, 1:22 am

Kasuha wrote:Search sorting does not restrict or narrow the search.

I think you understood incorrectly...
I meant this searching option should set searching order inside-to-outside, rather than outside-to-inside so it fits in meaning of 'expansion'.
(sorry for bad English. :oops: )
Call me "Dannyu NDos" in Forum. Call me "Bag Sinhwan"(박신환) in Wiki.
David
 
Posts: 211
Joined: November 3rd, 2009, 2:47 am
Location: Daejeon, South Korea

Re: JavaLifeSearch

Postby Kasuha » January 12th, 2013, 5:13 pm

David wrote:I think you understood incorrectly...
I meant this searching option should set searching order inside-to-outside, rather than outside-to-inside so it fits in meaning of 'expansion'.
(sorry for bad English. :oops: )

If you select a cell (in the start at column XXX, row YYY part), the sorting always goes from that cell out. Initially, cell at column 0, row 0 is always selected but that can be changed. Individual sorting options (horizontal, vertical, box, circle, ...) only define which way the direction is. You can check the sorting if you select the Pause after each iteration option, run the search and watch in which direction cells are filled.
Kasuha
 
Posts: 54
Joined: November 1st, 2012, 11:39 am

Re: JavaLifeSearch

Postby Kasuha » January 13th, 2013, 4:02 am

Version 1.7 brings two minor bug fixes:
- When there was an error in generation 0 cell (caused by incompatible constellation in last generation), the error was marked on a cell to the right of it.
- Reverse Order option also reversed the sorting of generations, too. Fixed to only reverse area-wise ordering.

Links were updated in the first post
Kasuha
 
Posts: 54
Joined: November 1st, 2012, 11:39 am

Re: JavaLifeSearch

Postby Kasuha » July 5th, 2013, 1:49 am

I noticed the manual link is not working. Fixed now.

I was also asked to provide more guidance for using JLS so I decided to provide an example with explanation. You can find the example attached to this post. Download it, unzip into p7_example.jdf, and open it with JLS.

The example contains early stage of search for a p7 sparker supporting a p14 reaction. What I have done so far was:

- create a p14 array (to hold the whole reaction) and set up all cells containing the reaction along with intended spark. That's the part on the left. The layer of Unset cells on the very left is there to prevent some of set cells coloring red to indicate error. It is not necessary but it looks better. IMO.

- set up the field as symmetric and the last subperiod to period 7 (from 6) in Preferences, then mark the intended rotor area as p7 (blue area)

- give the rotor some p1 stator area (yellow)

- set cells above and below two layers of stator area as unchecked to prevent the search unnecessarily evaluating all possible stators. This is reasonably safe. It has happened to me in crowded situations that the stator could not be found but it's very unlikely.

- "cap" the search area by unchecked cells from the right. This cap is to be gradually removed during search.

- change the Search options from defaults:
Set the "Use combinations to prune search" option
Unset the "Pause after each solution" option
(all other search options were left to defaults)

Further steps include:

1/ Run the search. When it finishes, cell settings common to all found solutions will be displayed as potential cell states.
Note: In the beginning I am not interested in all solutions; solutions which run into the wall of unchecked cells are often not valid. But using cell values which are common to all found solutions helps narrowing the search.

2/ Notice number and shape of these cells. If there is a lot of them, it won't be probably possible to continue and the search will report no solutions. In that case you might need to return to the very beginning and start with wider rotor area. If there's very few of them or even none and the checked area looks big enough, it might be possible to start narrowing the rotor area (changing p7 cells into p1).

2/ Accept found cell states (Search/Accept displayed state)

3/ Uncover another 2-4 layers of unchecked cells on the right of the p7 area, including 2 layers of stator. (Select them using mouse and use Shift+I to include them in search)

4/ If there are unset cells in the p1 area or even in the rotor which are surrounded by set cells, it is possible to set them to unchecked (Shift+O) to narrow the search

5/ If things look promising, start narrowing the rotor by turning p7 cells into p1.

6/ Start again from 1/

In the end when there is a solution found with no unchecked cells in rotor area, just mark all cells as checked and finish the stator using the same approach. I usually narrow the stator by gradually adding off cells from sides or corners to make it smaller. When the stator area breaks into pieces, it is possible to mark all but one as unchecked, finish that one part of stator and then continue with others.

Have fun!
Attachments
p7_example.zip
(2.06 KiB) Downloaded 257 times
Kasuha
 
Posts: 54
Joined: November 1st, 2012, 11:39 am

Re: JavaLifeSearch

Postby Freywa » July 7th, 2013, 6:28 am

Alright, so I've ran JLS to see how it works. The progress of my search on the p7 sparker is attached. What should I do next?
Attachments
p7_3.jdf.zip
(2.08 KiB) Downloaded 244 times
User avatar
Freywa
 
Posts: 274
Joined: June 23rd, 2011, 3:20 am
Location: Singapore

Re: JavaLifeSearch

Postby Kasuha » July 7th, 2013, 12:09 pm

Freywa wrote:Alright, so I've ran JLS to see how it works. The progress of my search on the p7 sparker is attached. What should I do next?

I'd suggest following the point 5 above - if things look promising, it's time to start narrowing the search and check if something comes out. For instance you can put a wall of p1 cells at the end of the p7 "barrel" and see some finite stator comes out.

My approach was to shape the p7 area to a "wedge" between two p7 walls, getting the narrower the further it was from the spark - and as soon as I found a result, I paused the search, displayed the combination found, accepted it and just finished the stator around it. Which means that there's possibly an even smaller sparker for this spark.
Kasuha
 
Posts: 54
Joined: November 1st, 2012, 11:39 am

Re: JavaLifeSearch

Postby Scorbie » January 1st, 2015, 4:52 am

Happy New Year!
Just to report two minor things.
1) The output file doesn't have an extension rather than .jdf and
2) Block move commands (ctrl+shift+arrows) doesn't move the subperiods of cells...
Still, It's good enough for me to use it happily. Thanks.
Best wishes to you, Scorbie
User avatar
Scorbie
 
Posts: 1322
Joined: December 7th, 2013, 1:05 am

Re: JavaLifeSearch

Postby codeholic » February 23rd, 2015, 3:39 pm

I'm trying to find the glider with JavaLifeSearch using shift and translation options simultaneously, but it seems either I do something wrong or JLS just doesn't support it. Could someone take a look?
Attachments
glider.jdf.gz
(729 Bytes) Downloaded 174 times
Ivan Fomichev
User avatar
codeholic
Moderator
 
Posts: 1138
Joined: September 13th, 2011, 8:23 am
Location: Hamburg, Germany

Re: JavaLifeSearch

Postby wildmyron » February 23rd, 2015, 11:47 pm

codeholic wrote:I'm trying to find the glider with JavaLifeSearch using shift and translation options simultaneously, but it seems either I do something wrong or JLS just doesn't support it. Could someone take a look?

It seems JLS does not support this combination. It doesn't seem to work for finding an LWSS either with horizontal shift and translation. From the manual:
JLS manual wrote:Combining translation other than None with spatial periodicity may lead to unrealistic search results and is not recommended.
wildmyron
 
Posts: 568
Joined: August 9th, 2013, 12:45 am

Re: JavaLifeSearch

Postby codeholic » February 24th, 2015, 2:56 am

wildmyron wrote: It doesn't seem to work for finding an LWSS either with horizontal shift and translation.

No, interestingly, it does (see the attachment).
wildmyron wrote:It seems JLS does not support this combination.

I wonder, if WLS supports it correctly, otherwise I don't know how Nicolay Beluchenko managed to find the seal.
Attachments
wss.jdf.gz
(720 Bytes) Downloaded 178 times
Ivan Fomichev
User avatar
codeholic
Moderator
 
Posts: 1138
Joined: September 13th, 2011, 8:23 am
Location: Hamburg, Germany


Return to Scripts

Who is online

Users browsing this forum: No registered users and 2 guests