Skip to content
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

latex, quality #413

Merged
merged 11 commits into from
Sep 21, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
more details
milesstoetzner committed Sep 15, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 40325d96dc8ac6e196fc49d5a5914e5442e56491
6 changes: 3 additions & 3 deletions src/controller/study/technology.ts
Original file line number Diff line number Diff line change
@@ -240,11 +240,11 @@ export default async function (options: StudyTechnologyOptions) {

qualityData.push({
scenario: original,
expert: quality.max_weight,
expert: quality.max_weight.weight,
non_expert: [quality.min_weight, quality.max_weight],
random: [quality.min_weight, quality.max_weight],
random: [quality.min_weight.weight, quality.max_weight.weight],
counting: [quality.min_count.min_count.weight, quality.min_count.max_count.weight],
quality: quality.max_weight,
quality: quality.max_weight.weight,
quality_counting: quality.max_weight_min_count.max_weight,
})
}
9 changes: 8 additions & 1 deletion src/controller/template/quality.ts
Original file line number Diff line number Diff line change
@@ -38,7 +38,14 @@ async function weight(options: TemplateQualityOptions, direction: 'min' | 'max')
})
const optimized = new Resolver(loaded.graph, loaded.inputs).optimize()
if (optimized.length !== 1) throw new Error(`Did not return correct quality`)
return utils.roundNumber(utils.first(optimized).quality.average)

const result = utils.first(optimized)

return {
weight: utils.roundNumber(result.quality.average),
direction,
count: result.technologies,
}
}

async function count(options: TemplateQualityOptions, direction: 'min' | 'max') {