Conflicting directionality of constraint and variable value diff
See original GitHub issueWhen you diff two models, the directionality (+/-) is opposite between the Constraint Differences and the Relative/Absolute Differences. I read sol2.diff(sol1)
as what is the diff going sol1 --> sol2
. See in the trivial example below that the Constraint Difference makes it look like the additional constraint has gone away (when it’s in fact the inverse) whereas the solution value has increased 100% (which it has).
In [1]: from gpkit import Variable, Model
In [2]: x = Variable("x")
In [3]: m1 = Model(x, [x >= 1])
In [4]: sol1 = m1.solve()
Solving took 0.151 seconds.
In [5]: m2 = Model(x, [x >= 1, x >= 2])
In [6]: sol2 = m2.solve()
Solving took 0.177 seconds.
In [7]: print(sol2.diff(sol1))
Solution Diff
=============
(positive means the argument is smaller)
Constraint Differences
**********************
--- removed in argument
+++ added in argument
@@ -6,4 +6,3 @@
Constraints
-----------
x >= 1
- x >= 2
**********************
Relative Differences |above 1%|
-------------------------------
x : +100.0%
Basically comes down to the slight contradiction between (positive means the argument is smaller)
and +++ added in argument
.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Conflicting directionality
1 Introduction. Certain kinds of complex phenomena serve as testing and proving grounds in phonology as theories develop and change.
Read more >Global Constraints
E.g., the alldiff(x1,...,xn) constraint forces that all the values of integer variables x1,...,xn must be different.
Read more >Constraint Satisfaction Problems and Techniques
This algorithm not only removes conflicting values but also maintains. Directional arc consistency among variables.We can prune off larger.
Read more >Auto Layout Guide: Anatomy of a Constraint - Apple Developer
Describes the constraint-based system for laying out user interface elements.
Read more >Mass minimization with conflicting dynamic constraints by ...
The problem can be formulated as an integer optimization problem where the design variables can take the values 0 or 1, with 1...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
d’oh I should have tried writing it out, that does work well. will implement!
Thanks!