Brunet.Graph.Graph.GetNearTarget C# (CSharp) Method

GetNearTarget() public method

public GetNearTarget ( AHAddress address ) : AHAddress
address AHAddress
return AHAddress
    public AHAddress GetNearTarget(AHAddress address)
    {
      /**
       * try to get at least one neighbor using forwarding through the 
       * leaf .  The forwarded address is 2 larger than the address of
       * the new node that is getting connected.
       */
      BigInteger local_int_add = address.ToBigInteger();
      //must have even addresses so increment twice
      local_int_add += 2;
      //Make sure we don't overflow:
      BigInteger tbi = new BigInteger(local_int_add % Address.Full);
      return new AHAddress(tbi);
    }