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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
/*
* File: NetStructures.h
* Author: Peter G. Jensen
*
* Created on 09 March 2016, 21:08
*/
#ifndef NETSTRUCTURES_H
#define NETSTRUCTURES_H
#include <limits>
#include <vector>
namespace PetriEngine {
struct Arc {
uint32_t place;
uint32_t weight;
bool skip = false;
bool inhib = false;
Arc() :
place(std::numeric_limits<uint32_t>::max()),
weight(std::numeric_limits<uint32_t>::max()),
skip(false),
inhib(false) {
};
bool operator < (const Arc& other) const
{
return place < other.place;
}
bool operator == (const Arc& other) const
{
return place == other.place && weight == other.weight && inhib == other.inhib;
}
};
struct Transition {
std::vector<Arc> pre;
std::vector<Arc> post;
bool skip = false;
bool inhib = false;
};
struct Place {
std::vector<uint32_t> consumers; // things consuming
std::vector<uint32_t> producers; // things producing
bool skip = false;
bool inhib = false;
};
}
#endif /* NETSTRUCTURES_H */
|