Project

General

Profile

Statistics
| Branch: | Revision:

root / src / sim / parsim / clinkdelaylookahead.h @ 81ad8b66

History | View | Annotate | Download (1.97 KB)

1
//=========================================================================
2
//  CLINKDELAYLOOKAHEAD.H - part of
3
//
4
//                  OMNeT++/OMNEST
5
//           Discrete System Simulation in C++
6
//
7
//  Author: Andras Varga, 2003
8
//          Dept. of Electrical and Computer Systems Engineering,
9
//          Monash University, Melbourne, Australia
10
//
11
//=========================================================================
12

    
13
/*--------------------------------------------------------------*
14
  Copyright (C) 2003-2008 Andras Varga
15
  Copyright (C) 2006-2008 OpenSim Ltd.
16

17
  This file is distributed WITHOUT ANY WARRANTY. See the file
18
  `license' for details on this and other legal matters.
19
*--------------------------------------------------------------*/
20

    
21
#ifndef __CLINKDELAYLOOKAHEAD_H__
22
#define __CLINKDELAYLOOKAHEAD_H__
23

    
24
#include "cnmplookahead.h"
25

    
26
NAMESPACE_BEGIN
27

    
28
/**
29
 * Lookahead calculation based on inter-partition link delays only.
30
 *
31
 * @ingroup Parsim
32
 */
33
class SIM_API cLinkDelayLookahead : public cNMPLookahead
34
{
35
  protected:
36
    struct PartitionInfo
37
    {
38
        simtime_t minDelay;  // minimum of all link delays to given partition
39
    };
40

    
41
    // partition information
42
    int numSeg;              // number of partitions
43
    PartitionInfo *segInfo;  // partition info array, size numSeg
44

    
45
  public:
46
    /**
47
     * Constructor.
48
     */
49
    cLinkDelayLookahead();
50

    
51
    /**
52
     * Destructor.
53
     */
54
    virtual ~cLinkDelayLookahead();
55

    
56
    /**
57
     * Sets up algorithm for new simulation run.
58
     */
59
    virtual void startRun();
60

    
61
    /**
62
     * Called at end of simulation run.
63
     */
64
    virtual void endRun();
65

    
66
    /**
67
     * Updates lookahead information, based on the delay of the link
68
     * where message is sent out. Returns EOT.
69
     */
70
    virtual simtime_t getCurrentLookahead(cMessage *msg, int procId, void *data);
71

    
72
    /**
73
     * Returns minimum of link delays toward the given partition.
74
     */
75
    virtual simtime_t getCurrentLookahead(int procId);
76
};
77

    
78
NAMESPACE_END
79

    
80

    
81
#endif
82

    
83