Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
advisor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
SRCT
advisor
Commits
de4f3a70
Commit
de4f3a70
authored
Mar 02, 2014
by
Daniel W Bond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commentary on how the algorithm works
parent
94088d25
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
advisor/mainapp/utils.py
advisor/mainapp/utils.py
+16
-10
No files found.
advisor/mainapp/utils.py
View file @
de4f3a70
...
...
@@ -44,6 +44,7 @@ def assignedWeights(weightedCourse, programCourses):
return
weights
def
courseWeighting
(
programCourses
):
""" a helper function for properly recursing """
weights
=
{}
...
...
@@ -88,14 +89,14 @@ def requirementsFulfilled(taken, program):
# in the trajectory """
# return True
def
remainingReqCourses
(
taken
,
program
):
def
remainingReqCourses
(
taken
,
program
Courses
):
""" returns the remaining required courses for a program given
the already taken courses """
taken
=
set
(
taken
)
courses
=
set
(
programCourses
(
program
)
)
programCourses
=
set
(
programCourses
)
remainingReqCourses
=
taken
.
intersection
(
c
ourses
)
remainingReqCourses
=
taken
.
intersection
(
programC
ourses
)
return
remainingReqCourses
...
...
@@ -149,28 +150,33 @@ def enoughCredits(previousCourses, numRequired):
return
enoughcredits
def
generatedTrajectory
():
def
generatedTrajectory
(
taken
,
program
):
generatedTrajectory
=
[]
# get the course's programs
programCourses
(
)
programCourses
=
programCourses
(
program
)
# find the weights of all of the programs
courseWeighting
()
courseWeighting
(
programCourses
)
# get the courses you have to take next
remainingReqCourses
()
requirementsFulfilled
()
nextCourses
()
remainingReqCourses
(
taken
,
programCourses
)
requirementsFulfilled
(
taken
,
program
)
nextCourses
(
remainingReqCourses
,
taken
)
# of those, pick five of the heaviest
### IMPLEMENT THIS
# associate courseWeights with nextCourses
# add a list of courses with the five highest weights from nextCourses to
# generated Trajectory
# add these new courses to taken
# retrieve the next courses you need to take, and so forth
remainingReqCourses
()
requirementsFulfilled
()
nextCourses
()
# if there are no remainingReqCourses or requirementsFulfilled is True
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment