Skip to content
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

generation of regex is not consistently repeatable #9

Open
GoogleCodeExporter opened this issue Dec 29, 2015 · 0 comments
Open

generation of regex is not consistently repeatable #9

GoogleCodeExporter opened this issue Dec 29, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

If I want to use a Random with a fixed seem across two instances of Xeger this 
randomly fails to generate the same set of regex values.

The reason seems to be because Automatom internally uses Set for most 
everything and the order of the Transitions is not guaranteed regardless if the 
regex are the same.

The solution is to change from using 

List<Transition> transitions = state.getSortedTransitions(true);

to 

List<Transition> transitions = state.getSortedTransitions(false);

This ensures that the order of transitions is consistent (because it is using 
the min / max values rather than the State number values which can differ)

I am unsure if this will always solve the problem.  The more bullet proof 
approach would be to get the upstream Automatum to use List rather than Set.

Original issue reported on code.google.com by [email protected] on 26 Jul 2012 at 2:00

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant