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

feature: Violating agents, allocation reasons and more #48

Closed
wants to merge 4 commits into from

Conversation

joelbarmettlerUZH
Copy link
Collaborator

No description provided.

@joelbarmettlerUZH joelbarmettlerUZH changed the base branch from master to dev September 12, 2022 11:05
Visualizer/src/API/enums.js Outdated Show resolved Hide resolved
Comment on lines 90 to 91
label: "Collisions",
value: simulation.statistics.totalNumberOfCollisions,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
label: "Collisions",
value: simulation.statistics.totalNumberOfCollisions,
label: "Violations",
value: simulation.statistics.totalNumberOfCollisions,

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename property as well. Should be called violations.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get it. The API property is called "total_number_of_collisions", I name it "totalNumberOfCollisions" and display it under the title "Collisions", but you are telling me it should be called Violations?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

habs in meinem PR gefixed

Co-authored-by: thommann <34217413+thommann@users.noreply.github.com>
Copy link
Owner

@johannschwabe johannschwabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm proud of you. But it's to complex

Comment on lines +285 to 316
const violationData = computed(() => {
return Object.entries(simulation.agentInFocus.violations)
.map(([agent_id, locations]) => {
return locations.map((loc) => ({
...loc,
agent: agent_id,
}));
})
.flat()
.reduce((acc, violation) => {
const subtitle = `Tick ${violation.t}`;
let entryIndex = acc.findIndex((v) => v.subtitle === subtitle);
if (entryIndex === -1) {
acc.push({
subtitle,
datapoints: [],
});
entryIndex = acc.length - 1;
}
const agent = simulation.agents.find((a) => a.id === violation.agent);
acc[entryIndex].datapoints.push({
label: `${agent.owner.name} > ${agent.id}`,
value: { x: violation.x, y: violation.y, z: violation.z },
icon: GitPullRequest,
onClick: () => {
simulation.focusOnAgent(agent);
},
});
return acc;
}, []);
});

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cyclic complexity to hight

@thommann thommann deleted the feature-ui-fixe branch September 14, 2022 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants