-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathNetworkNode.h
47 lines (34 loc) · 1.14 KB
/
NetworkNode.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
41
42
43
44
45
46
47
#ifndef _NETWORK_NODE_H_
#define _NETWORK_NODE_H_
#include "ParamCond.h"
class NetworkNode : public ParamCond {
public:
unsigned lower, upper;
ParamCondVec templates;
NetworkNode( const std::string & s )
: ParamCond( s ), lower( 0 ), upper( 0 ) {}
NetworkNode( const NetworkNode * n, Domain & d )
: ParamCond( n ), lower( n->lower ), upper( n->upper ) {
for ( unsigned i = 0; i < n->templates.size(); ++i )
templates.push_back( ( ParamCond * )n->templates[i]->copy( d ) );
}
~NetworkNode() {
for ( unsigned i = 0; i < templates.size(); ++i )
delete templates[i];
}
void print( std::ostream & stream ) const {
stream << "Network node ";
ParamCond::print( stream );
stream << " <" << lower << "," << upper << ">";
for ( unsigned i = 0; i < templates.size(); ++i )
stream << "\n Template: " << templates[i];
}
void PDDLPrint( std::ostream & s, unsigned indent, const TokenStruct< std::string > & ts, Domain & d );
void parse( Filereader & f, TokenStruct< std::string > & ts, Domain & d );
void addParams( int m, unsigned n ) {
}
Condition * copy( Domain & d ) {
return new NetworkNode( this, d );
}
};
#endif