Visualizzazione dei risultati da 1 a 4 su 4
  1. #1

    VB

    vorrei sapere qs istruzione in C++ cosa fa, sono all'interno di un simulatore di rete T->link[i][j].metric=(*f)(&T->link[i][j]);
    la funzione all'interno della quale si trova č:
    /*
    This function performs the basic Dijkstra shortest-path calculation on a graph
    in which all the links with insufficient bandwidth have been removed and the link metric
    is determined by the cost function f.
    */
    Path *ShortestPath(Topology *T, Flow *F, TLinkCostFunc f)
    {
    int i,j;
    Path* path;

    /* pruning of the links with insufficient bandwidth & setting up the link metric */

    for (i=0; i<T->getNumNodes(); i++)
    for (j=0; j<T->getNumNodes(); j++)
    #ifdef LS_UPDATE
    if (T->link[i][j].lastUpdateValue < F->getBwdr())
    #else
    if (T->link[i][j].availableBandwidth < F->getBwdr())
    #endif
    T->link[i][j].metric=-1.;
    else
    T->link[i][j].metric=(*f)(&T->link[i][j]);

    e qs č la classe topology

    class Topology
    {
    private:
    int numNodes;
    int numEdgeNodes; /* number of edge nodes */
    int numQoSconstr;
    void printTopology(FILE *f); /* print topology in an *opened* file */
    public:
    long accepted, /* number of accepted flows */
    ac_error, /* number of flows incorrectly routed by algorithm */
    rejected, /* number of flows rejected by algorithm */
    *due2QoS; /* number of flows routed by algorithm but not
    admitted due to QoS constraints */
    Tlink **link;
    int *edge_node;

    int getTopology(const char *filename, bool symmetric); /* get topology from file */
    void reset();
    void printTopology(const char *filename);
    void printTopology() { printTopology(stdout); }
    int getNumNodes() {return numNodes;}
    int getNumEdges() {return numEdgeNodes;}
    int getNumQoSconstr() {return numQoSconstr;}
    void releasePath(Flow *flow);
    int setupPath(Flow *flow, long Warmup);
    void updateAvgLoad(int n);
    };

    Penso che le informazioni che vi ho dato sono sufficienti, secosė non dovesse essere fatemi sapere

  2. #2
    Utente di HTML.it L'avatar di MMarzia
    Registrato dal
    Mar 2001
    Messaggi
    1,781
    e che c'entra VB? :master:


    comunque ti invito a leggere il nostro regolamento
    il titolo (che non deve essere troppo generico) deve riportare anche linguaggio ed eventualmente versione
    io sono festosamente cicciottello :: e. cartman

    t'amo senza sapere come, nč quando nč da dove,
    t'amo direttamente senza problemi nč orgoglio:
    cosė ti amo perchč non so amare altrimenti

  3. #3
    ...dove lo trovo?

  4. #4
    Utente di HTML.it L'avatar di MMarzia
    Registrato dal
    Mar 2001
    Messaggi
    1,781
    Originariamente inviato da mommismile
    ...dove lo trovo?
    č in rilevo, nella home del forum di programmazione

    http://forum.html.it/forum/showthrea...hreadid=762409
    io sono festosamente cicciottello :: e. cartman

    t'amo senza sapere come, nč quando nč da dove,
    t'amo direttamente senza problemi nč orgoglio:
    cosė ti amo perchč non so amare altrimenti

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.