-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedge.h
40 lines (32 loc) · 815 Bytes
/
edge.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef EDGE_H
#define EDGE_H
#include <QGraphicsLineItem>
#include "common.h"
class Edge
{
public:
Edge(QPointF p1, QPointF p2);
~Edge();
double addPheromone(double amount);
void doDecay();
void reset();
void setBest(bool best);
double getLength();
QGraphicsItem* getGraphicsItem();
double getPheromone();
void updateLine(double onBestTour);
static void setDecayRate(int rate);
static void setDefaultPheromone(double amount);
static void setShowPheromone(bool show);
static void setScale(double x, double y);
private:
QGraphicsLineItem *line;
double pheromone;
double length;
bool onBestTour;
static double decayRate;
static double defaultPheromone;
static bool showPheromone;
static double scale;
};
#endif // EDGE_H