Difference between revisions of "Visual network topoloy"

From Artificial Neural Network for PHP
 
Line 3: Line 3:
 
<source lang="php">
 
<source lang="php">
 
require_once 'ANN/Loader.php';
 
require_once 'ANN/Loader.php';
  +
  +
use ANN\Network;
  +
use ANN\NetworkGraph;
   
 
try
 
try
 
{
 
{
$objNetwork = ANN_Network::loadFromFile('xor.dat');
+
$objNetwork = Network::loadFromFile('xor.dat');
 
}
 
}
 
catch(Exception $e)
 
catch(Exception $e)
Line 13: Line 16:
 
}
 
}
   
$objNetworkImage = new ANN_NetworkGraph($objNetwork);
+
$objNetworkImage = new NetworkGraph($objNetwork);
   
 
$objNetworkImage->saveToFile('network.png');
 
$objNetworkImage->saveToFile('network.png');

Latest revision as of 13:12, 1 June 2011

PNG image of network topology

require_once 'ANN/Loader.php';

use ANN\Network;
use ANN\NetworkGraph;

try
{
  $objNetwork = Network::loadFromFile('xor.dat');
}
catch(Exception $e)
{
  die('Network not found');
}

$objNetworkImage = new NetworkGraph($objNetwork);

$objNetworkImage->saveToFile('network.png');

Output

Image of network toplogy