Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
topupopt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pmag
topupopt
Merge requests
!6
Stats
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
Stats
stats
into
master
Overview
0
Commits
14
Pipelines
0
Changes
2
Merged
pmag
requested to merge
stats
into
master
1 year ago
Overview
0
Commits
14
Pipelines
0
Changes
2
Problem statistics
Profile generation
Graph simplification
Tests for the above
0
0
Merge request reports
Viewing commit
d3c7d492
Prev
Next
Show latest version
2 files
+
143
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
d3c7d492
Finished consecutive_qpk method and added respetive tests.
· d3c7d492
Pedro L. Magalhães
authored
1 year ago
src/topupopt/problems/esipp/time.py
+
7
−
2
View file @ d3c7d492
Edit in single-file editor
Open in Web IDE
Show full file
@@ -134,8 +134,13 @@ class TimeFrame:
def
consecutive_qpk
(
self
,
qpk_keyed_dict
:
dict
)
->
bool
:
"
Returns True if all (q,p,k) tuple keys are valid and consecutive.
"
# TODO: here
raise
NotImplementedError
# all k intervals have to be consecutive for each (q,p) pair
set_qp
=
set
(
qpk
[
0
:
2
]
for
qpk
in
qpk_keyed_dict
.
keys
())
for
qp
in
set_qp
:
for
k
in
range
(
self
.
number_time_intervals
(
qp
[
0
])):
if
(
*
qp
,
k
)
not
in
qpk_keyed_dict
:
return
False
return
True
# *************************************************************************
# *************************************************************************
Loading