Last updated on Aug 22, 2025.

2. Building an observation network#

import netsse
vessel1 = netsse.base.Platform('Containership1')
vessel2 = netsse.base.Platform('RoRo1')
vessel3 = netsse.base.Platform()
print(vessel3.name)
PlatformOFUX7
network = netsse.base.Network(name='TestNetwork',nature='test',platforms=[vessel1,vessel2])
print([(platform.name,platform.owner) for platform in network.platforms])
[('Containership1', 'undefined'), ('RoRo1', 'undefined')]
network.add_platform(vessel3)
print([(platform.name,platform.owner) for platform in network.platforms])
Platform 'PlatformOFUX7' was added to the network.
[('Containership1', 'undefined'), ('RoRo1', 'undefined'), ('PlatformOFUX7', 'undefined')]
vessel2.owner = 'SomeCompany'
network.add_platform(vessel2)
print([(platform.name,platform.owner) for platform in network.platforms])
Platform 'RoRo1' in TestNetwork was updated with new information.
[('Containership1', 'undefined'), ('RoRo1', 'SomeCompany'), ('PlatformOFUX7', 'undefined')]
network.remove_platform(vessel3,'Containership1','NonExistentShip')
print([(platform.name,platform.owner) for platform in network.platforms])
Platform 'PlatformOFUX7' was removed from TestNetwork.
Platform 'Containership1' was removed from TestNetwork.
Platform 'NonExistentShip' not found.
[('RoRo1', 'SomeCompany')]