- Add permissions for issue writing
- Restrict job execution to specific repository owner
- Update action version from `main` to `v1` for stability and consistency
* added type aliases
* extracted methods
* more code documentation
* other minor stuff
note: self._update_state might be blunder. It might obfuscate behavior instead of help with readability. Might consider rolling back this specific change.
* extracted methods for end search checks
* removed takewhile abstraction and re-implemented potential_collapses using a for loop ( should be very explicit now )
* temperature and weight configs have their own dataclasses now, in shared_types.py
* use bool arg in get adjacent tiles to indicate explicitly whether out of bound tiles are included or excluded
* cache latest fetched adjacency coordinates.
! fix upper bounds when getting adjacent tile coords !
+ and missing outbound items when getting adjacent states.
* TODO: check if 5x5 roi zero check is still needed. since None positions are now filtered prior.
* might rollback some of the latest changes; they may not be improving readability...
- re-use adjacent_tiles_coords and avoid filtering valid indices within get_cell_potential_states_and_costs.
- in the same func, remove branching to get potential states and setup the correct func in the constructor.
- img is no longer scaled when dimensions don't match the tile size. Instead it is cropped from the pixel 0 to the height/width that fits the last full tile. Supposes that the (0,0) corner is a tile corner.
- separated updated_open_nodes into two different functions: close_node and reopen_node.
- re-implemented reopen_node using convolution (requires scipy and it is not yet used).
- other refactors for easier readability and linter stuff.
entropy is returned as before, but when computing costs the normalized entropy is used instead.
replaced comparisons w/ zero and commented out asserts that execute during the generation loop.
refactored some code blocks.
- comment related to the hashcode is not relevant in the current implementation.
- adjacency rules are required, otherwise can fail when sampling or generating; asserting they were obtained might prevent confusion.
- when computing possible next states, stop early if a contradiction or a collapse is found.
- search space is pruned -> when a state leads to a collapse, only the collapse is added to queue; this improves backtracking considerably, and should have been implemented at day 1.
also renamed open tiles variable.
entropy zero results in zero cost ( tries to force "collapse" cascade via the neighbors );
entropy is now used to weight rand & freq_adjust;
hash discriminates data order, e.g hash(1,2)!=hash(2,1) AND works similarly to zobrist, xoring prev state w/ the action instead of using the entire state.