Ejemplo n.º 1
0
bool IdentifyLiaisonTunnel::initNetwok()
{
    ObjectIdMap om( dg );
    if( !BuildNetwork( dg, om ) ) return false;
    FilterBlockEdges( dg, om, ef );
    if( !AddVirtualSTNode( dg, om, sn, tn ) ) return false;

    // 关联分支属性数据
    InitEdgeDatas( dg, om, datas );

    return true;
}
Ejemplo n.º 2
0
bool FindWindStation::initNetwok()
{
    ObjectIdMap om( dg );
    if( !BuildNetwork( dg, om ) ) return false;
    if( !AddVirtualSTNode( dg, om, sn, tn ) ) return false;
    FilterBlockEdges( dg, om, ef );

    // 关联分支属性数据
    InitEdgeDatas( dg, om, datas );

    return true;
}
Ejemplo n.º 3
0
 bool CplexAdapterBase::CreateNetworkProblem(const Graph &g) {
   /* Initialize the CPLEX environment */
   
   env_ = CPXopenCPLEX (&status_);
   
   /* If an error occurs, the status_ value indicates the reason for
    failure.  A call to CPXgeterrorstring will produce the text of
    the error message.  Note that CPXopenCPLEX produces no
    output, so the only way to see the cause of the error is to use
    CPXgeterrorstring.  For other CPLEX routines, the errors will
    be seen if the CPX_PARAM_SCRIND indicator is set to CPX_ON.  */
   
   if ( env_ == NULL ) {
     char  errmsg[CPXMESSAGEBUFSIZE];
     fprintf (stderr, "Could not open CPLEX environment.\n");
     CPXgeterrorstring (env_, status_, errmsg);
     fprintf (stderr, "%s", errmsg);
     Reset();
     return false;
   }
   
   /* Turn on output to the screen */
   
   status_ = CPXsetintparam (env_, CPX_PARAM_SCRIND, CPX_ON);
   if ( status_ ) {
     fprintf (stderr,
              "Failure to turn on screen indicator, error %d.\n", status_);
     Reset();
     return false;
   }
   
   /* Create the problem. */
   
   net_ = CPXNETcreateprob (env_, &status_, "netex1");
   
   /* A returned pointer of NULL may mean that not enough memory
    was available or there was some other problem.  In the case of
    failure, an error message will have been written to the error
    channel from inside CPLEX.  In this example, the setting of
    the parameter CPX_PARAM_SCRIND causes the error message to
    appear on stdout.  */
   
   if ( net_ == NULL ) {
     fprintf (stderr, "Failed to create network object.\n");
     Reset();
     return false;
   }
   
   /* Fill in the data for the problem.  Note that since the space for
    the data already exists in local variables, we pass the arrays
    directly to the routine to fill in the data structures.  */
   
   status_ = BuildNetwork(g);
   
   if ( status_ ) {
     fprintf (stderr, "Failed to build network problem.\n");
     Reset();
     return false;
   }
   
   return true;
 }