Commit 510a0458 authored by VAN TOLL Wouter's avatar VAN TOLL Wouter
Browse files

Small code improvements (no functional changes)

parent 766e1fa7
......@@ -70,8 +70,7 @@ public:
virtual Vector2D GetGlobalMinimum(Agent* agent, const WorldBase * world) const override;
/// <summary>Parses the parameters of the cost function.</summary>
/// <remarks>By default, ForceBasedFunction loads the "agentMass" parameter,
/// along with the parameters of the parent class CostFunction.
/// <remarks>By default, ForceBasedFunction simply calls the parent version, i.e. CostFunction::parseParameters().
/// Override this method to let it load any additional parameters of your interest.</remarks>
/// <param name="params">An XML block that contains all parameters of this cost function.</param>
void parseParameters(const CostFunctionParameters & params) override;
......@@ -64,7 +64,7 @@ Vector2D Policy::ComputeAcceleration(Agent* agent, WorldBase * world)
// - convert this to an acceleration using a relaxation time
// Note: the relaxation time should be at least the length of a frame.
return (bestVelocity - currentVelocity) / std::max(agent->getPolicy()->getRelaxationTime(), dt);
return (bestVelocity - currentVelocity) / std::max(relaxationTime_, dt);
Vector2D Policy::getAccelerationFromGradient(Agent* agent, WorldBase * world)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment