Skip to content

Commit

Permalink
add credit_balance()
Browse files Browse the repository at this point in the history
  • Loading branch information
heileman committed May 8, 2024
1 parent 94bec8a commit 8a8c268
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/DegreePlanAnalytics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,15 @@ function requisite_distance(plan::DegreePlan)
distance = distance + requisite_distance(plan, c)
end
return plan.metrics["requisite distance"] = distance
end

#TODO: write docstring, write tests
function credit_balance(plan::DegreePlan)
bal = 0
for i in 1:length(plan.terms)-1
for j in i+1:length(plan.terms)
bal += abs(plan.terms[i].credit_hours - plan.terms[j].credit_hours)
end
end
return bal
end

0 comments on commit 8a8c268

Please sign in to comment.