Commit 64bd5094 authored by Fabien Grzeskowiak's avatar Fabien Grzeskowiak
Browse files

#3 fix merge request

parents b77ba00f e74c5865
......@@ -5,8 +5,7 @@
#include <tools/vector2D.h>
#include <policy/Policy.h>
class Agent
{
class Agent {
private:
Vector2D position_;
Vector2D velocity_;
......
......@@ -6,14 +6,14 @@ CostFunction::CostFunction():
lambdaMovementCost_(1.0)
{}
float CostFunction::goalCost(){
float CostFunction::goalCost() {
return 0.0;
}
float CostFunction::avoidanceCost(){
float CostFunction::avoidanceCost() {
return 0.0;
}
float CostFunction::totalCost(){
float CostFunction::totalCost() {
return 0.0;
}
......@@ -4,8 +4,7 @@
#include <tools/vector2D.h>
//#include <world/world.h>
class CostFunction
{
class CostFunction {
private:
unsigned int agentId_;
float sigMovementCost_;
......
#ifndef LIB_SOLVER_H
#define LIB_SOLVER_H
class Solver {
public:
};
#endif //LIB_SOLVER_H
......@@ -3,42 +3,41 @@
#include <math.h>
class Vector2D
{
class Vector2D {
private:
float x_;
float y_;
public:
Vector2D(){
Vector2D() {
x_ = 0.0;
y_ = 0.0;
}
Vector2D(float xx, float yy){
Vector2D(float xx, float yy) {
x_ = xx;
y_ = yy;
}
Vector2D(Vector2D * v){
Vector2D(Vector2D * v) {
this->x_ = v->x_;
this->y_ = v->y_;
}
inline float magnitude() const{ return sqrt(x_ * x_ + y_ * y_); }
inline float magnitude() const { return sqrt(x_ * x_ + y_ * y_); }
inline float sqrMagnitude() const{ return x_ * x_ + y_ * y_; }
inline float sqrMagnitude() const { return x_ * x_ + y_ * y_; }
void normalize(){
void normalize() {
float mag = magnitude();
x_ /= mag;
y_ /= mag;
}
float dot(Vector2D * v){ return this->x_ * v->x_ + this->y_ * v->y_;}
float dot(Vector2D * v) { return this->x_ * v->x_ + this->y_ * v->y_;}
void set(float x, float y){
void set(float x, float y) {
this->x_ = x_;
this->y_ = y_;
}
......@@ -48,4 +47,4 @@ class Vector2D
inline float y() const{ return y_; }
};
#endif
#endif // LIB_VECTOR2D_H
#include <world/world.h>
World::World():
agents_(),obstacles_()
World::World()//:
//agents_(),obstacles_()
{
//! @warning the parameters used for initializing lqDB are not optimized, it should be determined, yet should work well
lqDB = lqCreateDatabase2D(0, 0, 10000, 10000, 10, 10);
......@@ -34,7 +34,6 @@ void World::perNeighborCallBackFunction(void *clientObject, float, void *clientQ
results.push_back ((Agent*)clientObject);
}
void World::doStep()
{
for(size_t i=0; i<agents_.size(); i++)
......
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