-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mandd/knapsack models #8
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some comments.
doc/user_manual/include/Knapsack.tex
Outdated
LOGOS contains a set of Knapsack models that can be used coupled with RAVEN when | ||
the desired optimization problem requires the use of specific models to generate | ||
knapsack required parameters. | ||
More specifically, all these models would be contained in a RAVEN ensembleModel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ensembleModel --> EnsembleModel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update the copyright statement, this one is not consistent with the version that we are using.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
src/knapsack/BaseKnapsackModel.py
Outdated
pass | ||
|
||
|
||
def run(self, container, Inputs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change "Inputs" to "inputs" or "inputDict"
src/knapsack/BaseKnapsackModel.py
Outdated
if key in Inputs.keys() and Inputs[key] in [0.0,1.0]: | ||
if Inputs[key] == 1.0: | ||
testValue = self.capacity - Inputs[container.mapping[key][1]] | ||
if testValue > 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testValue > 0 --> testValue >= 0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ouch, good catch!
tests/test_BaseKnapsackModel.xml
Outdated
@@ -0,0 +1,110 @@ | |||
<Simulation verbosity="debug"> | |||
<TestInfo> | |||
<name>[]</name> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update name info
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
elif child.tag == 'map': | ||
container.mapping[child.text.strip()] = [child.get('value'),child.get('cost')] | ||
elif child.tag == 'variables': | ||
variables = [str(var.strip()) for var in child.text.split(",")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the External Model for RAVEN, I think we'd better to use InputData and InputTypes to process the xml input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I may need some help here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have checked other External Models inside LOGOS, they are not using the InputData yet. If you want to use InputData for LOGOS, I suggest we open an issue, and adapt the InputData in another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue #9 has been opened.
We should have a chat on how to fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressing reviewer comments
doc/user_manual/include/Knapsack.tex
Outdated
LOGOS contains a set of Knapsack models that can be used coupled with RAVEN when | ||
the desired optimization problem requires the use of specific models to generate | ||
knapsack required parameters. | ||
More specifically, all these models would be contained in a RAVEN ensembleModel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
elif child.tag == 'map': | ||
container.mapping[child.text.strip()] = [child.get('value'),child.get('cost')] | ||
elif child.tag == 'variables': | ||
variables = [str(var.strip()) for var in child.text.split(",")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I may need some help here
src/knapsack/BaseKnapsackModel.py
Outdated
if key in Inputs.keys() and Inputs[key] in [0.0,1.0]: | ||
if Inputs[key] == 1.0: | ||
testValue = self.capacity - Inputs[container.mapping[key][1]] | ||
if testValue > 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ouch, good catch!
tests/test_BaseKnapsackModel.xml
Outdated
@@ -0,0 +1,110 @@ | |||
<Simulation verbosity="debug"> | |||
<TestInfo> | |||
<name>[]</name> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
This PR is good to be merged. |
It is needed to develop Knapsack models that can be used coupled with RAVEN when
the desired optimization problem requires the use of specific models to generate
knapsack required parameters.
Ref. Issue #7