Project

General

Profile

Revision 8b911557

ID8b91155720a5cfcd26b44d6e52b64f4de49d345d
Parent 0d3d896c
Child e702d896

Added by Mirko Stoffers about 7 years ago

Various fixes for heuristic

View differences:

include/eventtype.h
30 30
		pdf_t pdf;
31 31

  
32 32
	public:
33
		SuccessorEvent(EventType* const type, simtime_t firstSample) : pdf(firstSample)
33
		SuccessorEvent(EventType* const type, simtime_t firstSample, size_t callCount) : pdf(firstSample, callCount)
34 34
		{
35 35
			this->type=type;
36 36
		}
37 37

  
38
		SuccessorEvent(const cMessage* const msg, simtime_t firstSample) : pdf(firstSample)
39
		{
40
			cModule* mod=msg->getArrivalModule();
41
			type=mod->getEventType(msg);
42
		}
43 38

  
44 39
		bool operator==(const EventType& type) const
45 40
		{
......
67 62
		{
68 63
			pdf.sample(delay);
69 64
		}
65

  
66
		void setBaseLine(size_t newBaseLine)
67
		{
68
			pdf.setBaseLine(newBaseLine);
69
		}
70 70
};
71 71

  
72 72
class EventType
......
77 77
		int kind;
78 78
		int sender;
79 79
		cTTASLock succListLock;
80
		size_t callCount;
80 81

  
81 82
	public:
82 83
		EventType(const cMessage* const msg)
......
84 85
			modId=msg->getArrivalModuleId();
85 86
			kind=msg->getKind();
86 87
			sender=msg->getSenderModuleId();
88
			callCount=0;
87 89
		}
88 90

  
89 91
		bool operator==(const cMessage& msg)
......
129 131
			// If event type does not exist, create it:
130 132
			if(succ==NULL)
131 133
			{
132
				succs.emplace_back(t,delay);
134
				succs.emplace_back(t,delay,callCount);
133 135
				succ=&succs.back();
134 136
			}
135

  
136
			succ->sample(delay);
137
			else
138
			{
139
				succ->sample(delay);
140
			}
137 141
			succListLock.unlock();
138 142
		}
143

  
144
		void isCalled()
145
		{
146
			callCount++;
147
			for(succList_t::iterator it=succs.begin();it!=succs.end();++it)
148
			{
149
				it->setBaseLine(callCount);
150
			}
151
			// XXX: Don't like that. Must iterate over all the list :(
152
		}
139 153
};
140 154

  

Also available in: Unified diff