# cadvlinkdelaylookahead.h

    00001 //=========================================================================
    00002 //  CLINKDELAYLOOKAHEAD.H - part of
    00003 //
    00004 //                  OMNeT++/OMNEST
    00005 //           Discrete System Simulation in C++
    00006 //
    00007 //   Written by:  Andras Varga, 2003
    00008 //
    00009 //=========================================================================
    00010
    00011 /*--------------------------------------------------------------*
    00012   Copyright (C) 2003-2005 Andras Varga
    00013   Monash University, Dept. of Electrical and Computer Systems Eng.
    00014   Melbourne, Australia
    00015
    00016   This file is distributed WITHOUT ANY WARRANTY. See the file
    00017   `license' for details on this and other legal matters.
    00018 *--------------------------------------------------------------*/
    00019
    00020 #ifndef __CADVLINKDELAYLOOKAHEAD_H__
    00021 #define __CADVLINKDELAYLOOKAHEAD_H__
    00022
    00023 #include "cnmplookahead.h"
    00024
    00030 class cAdvancedLinkDelayLookahead : public cNMPLookahead
    00031 {
    00032   protected:
    00033     struct LinkOut
    00034     {
    00035         double lookahead;    // lookahead on this link (currently the link delay)
    00036         double eot;          // current EOT on this link (last msg sent + lookahead)
    00037     };
    00038     struct PartitionInfo
    00039     {
    00040         int numLinks;        // size of links[] array
    00041         LinkOut **links;     // information on outgoing links (needed for EOT calculation)
    00042         double lookahead;    // lookahead to partition (minimum of all link lookaheads)
    00043     };
    00044
    00045     // partition information
    00046     int numSeg;            // number of partitions
    00047     PartitionInfo *segInfo;  // partition info array, size numSeg
    00048
    00049   public:
    00053     cAdvancedLinkDelayLookahead();
    00054
    00058     virtual ~cAdvancedLinkDelayLookahead();
    00059
    00063     virtual void startRun();
    00064
    00068     virtual void endRun();
    00069
    00074     virtual double getCurrentLookahead(cMessage *msg, int procId, void *data);
    00075
    00079     virtual double getCurrentLookahead(int procId);
    00080 };
    00081
    00082 #endif
    00083
    00084