Skip to content

ArgumentOutOfRangeException with certain input #105

@TechGoon

Description

@TechGoon

Hello!

I've been messing around with different inputs to understand WFC better, and hit a case that throws an exception, and I'm not sure whether this is a bug or just a combination of inputs that it can't handle.

To reproduce the issue, use this input image:

Image

and add this line to samples.xml
<overlapping name="mine02" N="3" periodicInput="False" periodic="False" />

The result is:

< mine02
> CONTRADICTION
> DONE
Unhandled exception. System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at OverlappingModel.Save(String filename) in D:\dev\WaveFunctionCollapse\OverlappingModel.cs:line 116
   at Program.Main() in D:\dev\WaveFunctionCollapse\Program.cs:line 59

Looking at the code, I can see that the value at the requested index of the observed array is still -1 from being Clear()ed, so the patterns array is, understandably, upset about that.

Thank you for your time!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions