nns.c
1.0.1
Nanowire Network simulator
|
Provides functions to serialize various components of a nanowire network. More...
#include "device/network.h"
#include "device/component.h"
#include "interface/interface.h"
#include "interface/mea.h"
Go to the source code of this file.
Functions | |
void | serialize_network (const datasheet ds, const network_topology nt, char *path, int id) |
Serialize the static characteristics of the Nanowire Network to a file named "nn.nns" in a folder named "device_ID", where ID is the univocal identifier of the NN. Any other file named the same will be overwritten. If any problem occurs, the program will exit with an error. More... | |
void | serialize_state (const datasheet ds, const network_topology nt, const network_state ns, char *path, int id, int step) |
Serialize the network state (a.k.a. electrical equivalent circuit) to a file named "ns_STEP.nns" in a folder named "device_ID", where ID is the univocal identifier of the NN and STEP is the snapshot instant. Any other file named the same will be overwritten. If any problem occurs, the program will exit with an error. More... | |
void | serialize_component (const connected_component cc, char *path, int nn_id, int cc_id) |
Serialize a connected component of a nanowire network to a file named "cc_CC_ID.nns" in a folder named "device_ID", where NN_ID is the univocal identifier of the NN and CC_ID is the univocal identified of the CC. Any other file named the same will be overwritten. If any problem occurs, the program will exit with an error. More... | |
void | serialize_interface (const interface it, char *path, int id, int step) |
Serialize the network interface to a file named "it_STEP.nns" in a folder named "device_ID", where ID is the univocal identifier of the NN and STEP is the instant in which the interface was saved. Any other file named the same will be overwritten. If any problem occurs, the program will exit with an error. More... | |
void | serialize_mea (const MEA mea, char *path, int id, int step) |
Serialize the network MEA to a file named "mea_STEP.nns" in a folder named "device_ID", where ID is the univocal identifier of the NN and STEP is the instant in which the MEA was saved. Any other file named the same will be overwritten. If any problem occurs, the program will exit with an error. More... | |
Provides functions to serialize various components of a nanowire network.
This file contains function declarations for serializing datasheet and topology of a network, network state, connected components, network interface, and MEA (Multi-Electrode Array) to disk. Each serialization function creates or overwrites files in a folder named after the device identifier, following a specific naming convention for the files.
The functions ensure that any existing file with the same name will be replaced and will exit with an error if any issue occurs during the file operations.
void serialize_component | ( | const connected_component | cc, |
char * | path, | ||
int | nn_id, | ||
int | cc_id | ||
) |
Serialize a connected component of a nanowire network to a file named "cc_CC_ID.nns" in a folder named "device_ID", where NN_ID is the univocal identifier of the NN and CC_ID is the univocal identified of the CC. Any other file named the same will be overwritten. If any problem occurs, the program will exit with an error.
[in] | cc | The connected component to serialize. |
[in] | path | The base path in which put the /device_ID folder. |
[in] | nn_id | The univocal id of the network that will determine its file name. |
[in] | cc_id | The index of the connected component. |
void serialize_interface | ( | const interface | it, |
char * | path, | ||
int | id, | ||
int | step | ||
) |
Serialize the network interface to a file named "it_STEP.nns" in a folder named "device_ID", where ID is the univocal identifier of the NN and STEP is the instant in which the interface was saved. Any other file named the same will be overwritten. If any problem occurs, the program will exit with an error.
[in] | it | The interface to serialize. |
[in] | path | The base path in which put the /device_ID folder. |
[in] | id | The univocal id of the network that will determine its file name. |
[in] | step | The id of the network interface in a specific instant. |
void serialize_mea | ( | const MEA | mea, |
char * | path, | ||
int | id, | ||
int | step | ||
) |
void serialize_network | ( | const datasheet | ds, |
const network_topology | nt, | ||
char * | path, | ||
int | id | ||
) |
Serialize the static characteristics of the Nanowire Network to a file named "nn.nns" in a folder named "device_ID", where ID is the univocal identifier of the NN. Any other file named the same will be overwritten. If any problem occurs, the program will exit with an error.
[in] | ds | The datasheet to serialize. |
[in] | nt | The network topology to serialize. |
[in] | path | The base path in which put the /device_ID folder. |
[in] | id | The univocal id of the network that will determine its file name. |
void serialize_state | ( | const datasheet | ds, |
const network_topology | nt, | ||
const network_state | ns, | ||
char * | path, | ||
int | id, | ||
int | step | ||
) |
Serialize the network state (a.k.a. electrical equivalent circuit) to a file named "ns_STEP.nns" in a folder named "device_ID", where ID is the univocal identifier of the NN and STEP is the snapshot instant. Any other file named the same will be overwritten. If any problem occurs, the program will exit with an error.
[in] | ds | The datasheet of the nanowire network to serialize. |
[in] | nt | The topology of the nanowire network to serialize. |
[in] | ns | The network state to serialize. |
[in] | path | The base path in which put the /device_ID folder. |
[in] | id | The univocal id of the network that will determine its file name. |
[in] | step | The id of the network state in a specific instant. |