Visual network topoloy: Difference between revisions
From Artificial Neural Network for PHP
(2 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
<source lang="php"> |
<source lang="php"> |
||
require_once 'ANN/ |
require_once 'ANN/Loader.php'; |
||
use ANN\Network; |
|||
use ANN\NetworkGraph; |
|||
try |
try |
||
{ |
{ |
||
$objNetwork = |
$objNetwork = Network::loadFromFile('xor.dat'); |
||
} |
} |
||
catch(Exception $e) |
catch(Exception $e) |
||
{ |
{ |
||
die('Network not found'); |
|||
exit; |
|||
} |
} |
||
$objNetworkImage = new |
$objNetworkImage = new NetworkGraph($objNetwork); |
||
$objNetworkImage->saveToFile('network.png'); |
$objNetworkImage->saveToFile('network.png'); |
Latest revision as of 12: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');