private Tuple<Message,Connection> tryOtherMessages(){
  List<Tuple<Message,Connection>> messages=new ArrayList<Tuple<Message,Connection>>();
  Collection<Message> msgCollection=getMessageCollection();
  for (  Connection con : getConnections()) {
    DTNHost other=con.getOtherNode(getHost());
    ProphetRouterWithEstimation othRouter=(ProphetRouterWithEstimation)other.getRouter();
    if (othRouter.isTransferring()) {
      continue;
    }
    for (    Message m : msgCollection) {
      if (othRouter.hasMessage(m.getId())) {
        continue;
      }
      if (othRouter.getPredFor(m.getTo()) > getPredFor(m.getTo())) {
        messages.add(new Tuple<Message,Connection>(m,con));
      }
    }
  }
  if (messages.size() == 0) {
    return null;
  }
  Collections.sort(messages,new TupleComparator());
  return tryMessagesForConnected(messages);
}

private Tuple < Message , Connection > tryOtherMessages ( ) { List < Tuple < Message , Connection > > messages = new ArrayList < Tuple < Message , Connection > > ( ) ; Collection < Message > msgCollection = getMessageCollection ( ) ; for ( Connection con : getConnections ( ) ) { DTNHost other = con . getOtherNode ( getHost ( ) ) ; ProphetRouterWithEstimation othRouter = ( ProphetRouterWithEstimation ) other . getRouter ( ) ; if ( othRouter . isTransferring ( ) ) { continue ; } for ( Message m : msgCollection ) { if ( othRouter . hasMessage ( m . getId ( ) ) ) { continue ; } if ( othRouter . getPredFor ( m . getTo ( ) ) > getPredFor ( m . getTo ( ) ) ) { messages . add ( new Tuple < Message , Connection > ( m , con ) ) ; } } } if ( messages . size ( ) == 0 ) { return null ; } Collections . sort ( messages , new TupleComparator ( ) ) ; return tryMessagesForConnected ( messages ) ; }
tries to send all other messages to all connected hosts ordered by their delivery probability
