Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
Horizon Simulation Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
redmine-legacy
Horizon Simulation Framework
Commits
14650391
Commit
14650391
authored
Dec 21, 2011
by
Simon Tenbusch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[sequencechart]
- fixed bug in critical path calculation
parent
76c7d000
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
src/eventlog/ievent.cc
src/eventlog/ievent.cc
+1
-0
src/eventlog/ievent.h
src/eventlog/ievent.h
+11
-0
src/eventlog/sequencechartfacade.cc
src/eventlog/sequencechartfacade.cc
+6
-2
No files found.
src/eventlog/ievent.cc
View file @
14650391
...
...
@@ -23,6 +23,7 @@ IEvent::IEvent()
{
nextEvent
=
NULL
;
previousEvent
=
NULL
;
criticalPredecessor
=
NULL
;
cachedTimelineCoordinate
=
-
1
;
cachedTimelineCoordinateSystemVersion
=
-
1
;
}
...
...
src/eventlog/ievent.h
View file @
14650391
...
...
@@ -30,6 +30,8 @@ class EVENTLOG_API IEvent
IEvent
*
previousEvent
;
IEvent
*
nextEvent
;
IEvent
*
criticalPredecessor
;
public:
// gui state for SequenceChart
double
cachedTimelineCoordinate
;
...
...
@@ -143,6 +145,15 @@ class EVENTLOG_API IEvent
*/
static
void
linkEvents
(
IEvent
*
previousEvent
,
IEvent
*
nextEvent
);
static
void
unlinkEvents
(
IEvent
*
previousEvent
,
IEvent
*
nextEvent
);
IEvent
*
getCriticalPredecessor
()
{
return
criticalPredecessor
;
}
void
setCriticalPredecessor
(
IEvent
*
e
)
{
criticalPredecessor
=
e
;
}
};
NAMESPACE_END
...
...
src/eventlog/sequencechartfacade.cc
View file @
14650391
...
...
@@ -894,6 +894,9 @@ void SequenceChartFacade::calculateCriticalPath() {
if
(
current
->
getEventEndEntry
())
{
current
->
earliestProcessingTime
=
current
->
getComplexity
();
}
current
->
setCriticalPredecessor
(
eventLog
->
getFirstEvent
());
for
(
IEvent
*
antecessor
=
eventLog
->
getFirstEvent
();
antecessor
;
antecessor
=
antecessor
->
getNextEvent
())
{
if
(
antecessor
==
current
)
{
break
;
//We have to consider earlier events only
...
...
@@ -903,6 +906,7 @@ void SequenceChartFacade::calculateCriticalPath() {
}
if
(
antecessor
->
earliestProcessingTime
+
current
->
getComplexity
()
>
current
->
earliestProcessingTime
)
{
current
->
earliestProcessingTime
=
antecessor
->
earliestProcessingTime
+
current
->
getComplexity
();
current
->
setCriticalPredecessor
(
antecessor
);
}
}
// Memorize max event
...
...
@@ -911,9 +915,9 @@ void SequenceChartFacade::calculateCriticalPath() {
maxEarliestProcessingTimeEvent
=
current
;
}
}
//Now produce the convex hull of predecessors:
//Now produce the convex hull of
critical antecessors/
predecessors:
cachedCriticalPath
.
clear
();
for
(
IEvent
*
predecessor
=
maxEarliestProcessingTimeEvent
;
predecessor
;
predecessor
=
predecessor
->
getC
auseEvent
())
{
for
(
IEvent
*
predecessor
=
maxEarliestProcessingTimeEvent
;
predecessor
;
predecessor
=
predecessor
->
getC
riticalPredecessor
())
{
cachedCriticalPath
.
insert
((
ptr_t
)
predecessor
);
if
(
predecessor
->
getEventNumber
()
==
0
)
{
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment