new solvable level sample (softstar 59):
###### #####
##@# ### ##
# $ # $ #
# $ # $ #
### ###### #
### ## ##$###
# $ #### ..#
# $ $ $ ...#
# ####...#
# $$ # #...#
# ### #####
####
some UI improvement.
Thanks,
/Yin
That's good to know. At least we know the problem now. :-)
> occurs in normal solver mode, A message "Out of memory. Please save and
> then restart the program." is shown. This situation is not correctly
> handled in optimizer mode, so the bug occurs.
I wanted to ask you this question for times already but forgot about it:
When running in solver mode and you get the message
"Out of memory. Please save and then restart the program."
How do you save and do you restart ? Does restart allow you to
continue where you've left ?
> In this situation, BoxSearch can't get more memory from windows
> system. This error can be detected but the program can not recover
> from this error. I will fix this bug by give error message suggesting
> the user to save&quit. (I'm not sure whether the current result of
> optimizing can be rescued, I need you to test again.)
To me the unlimit memory (setting it to 0) option is somewhat useless....
If I have X amount of memory and boxsearch can't finish the job and in
the end it will give me an "out of memory" memory, what good is it to
allow a number that's larger than what's available in the system ?
I remember that when I limit the memory to 1.9G, I didn't get this
error and boxsearch returns a valid solution. So, my question to you
is: can boxsearch automatically determine how much memory is in the
system use that as the limit ?
Thanks!
yin sun 写道:
To dectect the memory status in precision is impossible, because the
system memory is dynamically shared by all programs in windows.
However, I can detect "low memory" instead of "no memory". but this
causes some "usable memory waste". How do you think about it?
I think the "save" part is confusing. It's better to just say "Out of
memory, can't proceed with solving." Or just as simple as "Out of
memory" -- it's clear enough on what the problem.
There's no need to mention the "save" part because I believe boxsearch
will prompt the user if there's something needs to be saved if the
user tries to exit.
> To dectect the memory status in precision is impossible, because the
> system memory is dynamically shared by all programs in windows.
> However, I can detect "low memory" instead of "no memory". but this
> causes some "usable memory waste". How do you think about it?
I was trying to suggest: If boxsearch can detect the MAX memory the
user has, why not set the "memory limit" to be that number instead of
0 (unlimited) ?
I understand, the actual available memory can change because the
memory is shared with all running programs. But that memory can be
freed too -- it's probably in the user's best interest to close all
programs before running boxsearch. I was simply suggesting for a
default value for the "memory limit" field.
Now I have a question. I remembered that when I set the limit to
1.9G, it returns a valid answer. And we know that if I don't set a
memory limit, it returns an invalid answer (due to out of memory).
How does memory limitation works ?
Is it that when you detected memory is above the set-value, you simply
end the optimization ?
I did notice that memory allocation seems to be different between 1.9G
& 0 (unlimited). When running with 1.9G memory limitation, boxsearch
seems to increase the memory usage much slower versus it's much
quicker with unlimited memory.
I have a suggestion: In the case that optimizer is running out of
memory, acknowledge the user of the problem and also return the best
solution that it obtained so far (as if the user hit the cancel
button during optimization).
Thanks!
Because "MAX memory" is not the same as "Usable memory". "Usable
memory" contains following parts:
1. free phisical memory.
2. free virtual memory (phisically page file on disk).
3. potential enlarged virtual memory.
(1) & (2) is dynamically changed every seconds;
(3) is determined by system settings & free disk space at the moment
when windows decide to enlarge page file size.
It's like a bank: there is a large number on the account, but it's
impossible to change all of it into cash in most cases.
> Now I have a question. I remembered that when I set the limit to
> 1.9G, it returns a valid answer. And we know that if I don't set a
> memory limit, it returns an invalid answer (due to out of memory).
>
> How does memory limitation works ?
> Is it that when you detected memory is above the set-value, you simply
> end the optimization ?
Yes.
> I did notice that memory allocation seems to be different between 1.9G
> & 0 (unlimited). When running with 1.9G memory limitation, boxsearch
> seems to increase the memory usage much slower versus it's much
> quicker with unlimited memory.
I guess you only watch physical memory usage. If you also watch virtual
memory usage, you will find there is no diffirence. Try "view-select
column" menu of task manager.
>
> I have a suggestion: In the case that optimizer is running out of
> memory, acknowledge the user of the problem and also return the best
> solution that it obtained so far (as if the user hit the cancel
> button during optimization).
>
I will think about it.
And more, I have to say, in 32bit windows, total usable memory of a
single program is no more than 2G. So set limitation to 2047M is
enough. There's some method can enlarge the limitation to about 4G, but
it's too complex for the structure of BoxSearch. I'm waiting for the
coming 64bit new age.
With the current limitation of CPU and memory and time, do you have a
list about which level is auto-solved which is not.
Buy the way, is there "Solver program interface standard" on the world
? It will be very useful for integrating solver into popular sokoban
games.
open source Sokoban YASC also supports it
I am not sure how popular they are. But the google result is pretty top.
/Yin
> Buy the way, is there "Solver program interface standard" on the world
> ? It will be very useful for integrating solver into popular sokoban
> games.
Not sure if there really is a standard. I know SokoYASC allows solver plugins.
The author, Brian, also wrote a sokoban solver (YASS) as well.
You can read more info from the site:
https://sourceforge.net/projects/sokobanyasc/
The source codes for both SokoYASC and YASS are also available.
(There's even a sokoban level generator.)
If you can't find the info on the homepage, you can contact the author
for more info on the interface
I prefer to run BoxSearch as a stand-alone app. However, I think it's
nice to have a boxsearch plugin for SokoYASC.