-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removes the option to zip or not the binary serialisation format #356
Conversation
Simplifies lots of serialisation function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Code Health Quality Gates: OK
Change in average Code Health of affected files: -0.00 (9.60 -> 9.60)
Now it's the record experiments that are broken, when I try to step back nothing happens and I have this message:
|
The two functions are now being used only in one place, offering the possibility to turn it off or on much more easily.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Code Health Quality Gates: OK
Change in average Code Health of affected files: -0.00 (9.60 -> 9.60)
The issue(s) should now be completely fixed. |
I still noticed a problem, when trying to restore agents from a file in the
All other serialisation models work properly |
Make sure you clean your directory before. Agents / Simulations files are not overwritten, so you may have old ones in your directory |
Yes I tried to remove previous saved agents and even create a new workspace but I still have this problem |
I couldn't reproduce the problem you described on macOS. So i tried the model in a Windows installation and I do not have any problem... Restoring and recreating agents from disk work w/o problems. |
I tried on two other computers and can reproduce it. I forgot to add this part of the exception:
Also it seems to at least partially work so maybe the error stack is written in the console of eclipse but the error is handled by gama and another mechanism is called to finish the work ? |
I followed the execution step by step and it is indeed just an "expected" error message found in the console, and the execution continues to something else, there is no actual bug. It is caused by the public static void restoreFromString(final IAgent agent, final String string) {
try {
restoreFromBytes(agent, string.getBytes(STRING_BYTE_ARRAY_CHARSET));
} catch (Throwable e) {
try {
restoreFromFile(agent, string);
} catch (Throwable ex) {
GAMA.reportAndThrowIfNeeded(agent.getScope(), GamaRuntimeException.create(ex, agent.getScope()), true);
}
}
} Even though it is not clear from that code, when public Object asObject(final byte b[]) {
try {
final byte[] input = ByteArrayZipper.unzip(b);
return getObjectInput(input).readObject();
} catch (Exception e) {
System.out.println("unable to decode:" + new String(b, 0, 0, Math.min(b.length, 100)));
FSTUtil.<RuntimeException> rethrow(e);
}
return null;
} |
Simplifies lots of serialisation function. Fixes #351