dwavesystems / dwavesystems/dwave-optimization

Consider adding state printing

Open
#157 0 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
31
Forks
36
Avg merge
16h 55m
Merged PRs (30d)
8

Description

It would be nice to be able to print all of the decisions/intermediate states of the model. Something like
```python
>>> print(model.states)
BinaryVariable(5) = [0, 1, 0, 0, 0]
IntegerVariable((2, 3)) = [[0, 15, 5], [1, 4, 2]]
```
something like this can be accomplished now with
```python
for symbol in model.iter_decisions():
print(type(symbol))
print(symbol.state())
```
but there are many design issues here.
1) What order do we print the symbols? Topological? Do we require a locked model in order to print? And without some sort of labeling (see #17) and/or symbol printing (see #133) it would be hard to disambiguate the symbol that's being printed
2) Do we print the state of all intermediate symbols or just the decisions? Do we want to make this configurable?
3) Do we always print all states? Just the first? Make this configurable?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.