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

Remove normDensity function from Street class #216

Merged
merged 2 commits into from
Nov 15, 2024
Merged

Conversation

Grufoony
Copy link
Collaborator

No description provided.

@@ -1364,7 +1364,7 @@
const auto& agent{this->m_agents[agentId]};
const auto& street{this->m_graph.streetSet()[agent->streetId().value()]};
double speed{street->maxSpeed() *
(1. - this->m_minSpeedRateo * street->normDensity())};
(1. - this->m_minSpeedRateo * street->density(true))};

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.1 rule Note

MISRA 12.1 rule
@@ -153,6 +153,11 @@
return nAgents;
}

double Street::density(bool normalized) const {
return normalized ? nAgents() / static_cast<double>(m_capacity)
: nAgents() / (m_len * m_nLanes);

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 10.4 rule Note

MISRA 10.4 rule
/// @brief Get the street's normalized density
/// @return double, The street's normalized density
double normDensity() const { return nAgents() / static_cast<double>(m_capacity); }
double density(bool normalized = false) const;

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 13.4 rule Note

MISRA 13.4 rule
/// @brief Get the street's normalized density
/// @return double, The street's normalized density
double normDensity() const { return nAgents() / static_cast<double>(m_capacity); }
double density(bool normalized = false) const;

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 17.8 rule Note

MISRA 17.8 rule
@Grufoony Grufoony merged commit 362e2c5 into main Nov 15, 2024
24 checks passed
@Grufoony Grufoony deleted the rework_streetDensity branch November 15, 2024 16:02
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.

1 participant