Commit Graph
17 Commits
Author SHA1 Message Date
Arthur O'Dwyer 51178c049d Inline trivial function Bond.get_source(). NFC. 2017-04-18 01:12:21 -07:00
Arthur O'Dwyer a41b639487 Remove global variable coderackPressures (bugfix?)
Before this patch, `coderackPressures.updatePressures()` was always
a no-op, as evidenced by the until-now-harmless misspelling of Python's
list `remove` operation as `removeElement`.

I can't tell if this broke anything; my tests still pass.
2017-04-18 01:12:21 -07:00
Arthur O'Dwyer 5423d078e8 Move updateTemperature() from workspaceFormulas to workspace.
And remove dead and/or logging code to simplify the logic.
2017-04-18 01:12:21 -07:00
Arthur O'Dwyer 8171b68cbe Remove some unused global variables. NFC. 2017-04-18 01:12:20 -07:00
Arthur O'Dwyer 6fcf2f3350 git rm grouprun.py 2017-04-18 01:12:20 -07:00
Arthur O'Dwyer d60ba5277c Remove a crash-causing line in slipnet.py.
Without this patch, `python main.py abc aabbcc milk` will reliably crash.
I believe what happens here is that we initialize all the slipnodes and
everything, and then `slipnet.predecessor` becomes `None`, which means
that if that concept ever arises on its own (vs. arising as the "opposite"
of "successor"), we'll be passing around `None` instead of a proper `Slipnode`
and everything goes sideways.

This line doesn't correspond obviously to anything in the Java code,
so I think it's just bogus --- an experiment in "brain damage" that was
accidentally committed?
2017-04-18 01:07:51 -07:00
Arthur O'Dwyer 0ff9d49111 Further Pythonicity and flake8 cleanup. NFC. 2017-04-16 18:22:57 -07:00
Arthur O'Dwyer 31323cd2bc Add some end-to-end tests!
These tests are intended to protect against regressions in the high-level
behavior of Copycat. They're not super precise, and they're VERY slow.
2017-04-16 18:22:57 -07:00
Arthur O'Dwyer 8e10814802 Further Pythonicity; and remove a bunch of logging from the inner loop. 2017-04-16 01:19:36 -07:00
Arthur O'Dwyer 77bfaaf5a7 Further refactor the main harness. Print average time for each solution. 2017-04-16 00:55:18 -07:00
Arthur O'Dwyer 3103f54ada Untie some loopy logic in addCodelet. (Functional change!) 2017-04-15 23:08:12 -07:00
Arthur O'Dwyer e094160dcd More Pythonic cleanups. NFC. 2017-04-15 23:07:28 -07:00
Arthur O'Dwyer a2260cdaf6 Run multiple iterations. Print final temperatures. Reduce stdout spew.
This makes the output of the program more closely resemble that of the
original Copycat described in "FCCA" page 236:

> [T]he average final temperature of an answer can be thought of as
> the program's own assessment of that answer's quality, with lower
> temperatures meaning higher quality.

For example, running `python main.py abc abd ijk 100` produced the
following output:

    ijl: 98 (avg temp 16.0)
    jjk: 1 (avg temp 56.3)
    ijk: 1 (avg temp 57.9)

And for `python main.py abc abd ijkk 100`:

    ijkkk: 2 (avg temp 19.8)
    ijkl: 51 (avg temp 28.1)
    ijll: 46 (avg temp 28.9)
    djkk: 1 (avg temp 77.4)
2017-04-15 22:29:46 -07:00
Arthur O'Dwyer ed1d95896e More Pythonic idioms in coderackPressure.py.
No functional change.
2017-04-15 22:29:46 -07:00
Arthur O'Dwyer 88ee2ddd8d Spelling: neighbour -> neighbor.
The old code mixed both spellings; we might as well be consistent.
2017-04-15 22:29:46 -07:00
Arthur O'Dwyer 5735888d02 Minor Pythonicity cleanups.
No functional change.
2017-04-14 11:37:43 -07:00
Arthur O'Dwyer 69f75c3f42 Spelling: slipability -> slippability
No functional change.
2017-04-14 11:19:25 -07:00