nns.c
1.0.1
Nanowire Network simulator
|
Defines deserialization functions for all the data structures of the library. 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 | deserialize_network (datasheet *ds, network_topology *nt, char *path, int id) |
Deserialize the static characteristics of the network from a file named "nanowire_network.ID.dat", where ID is the univocal identifier of the NN. If any problem occurs, the program will exit with an error. More... | |
void | deserialize_state (const datasheet ds, const network_topology nt, network_state *ns, char *path, int id, int step) |
Deserialize the state of the network from a file named "nanowire_state.ID.dat", where ID is the univocal identifier of the NN. If any problem occurs, the program will exit with an error. More... | |
void | deserialize_component (connected_component *cc, char *path, int nn_id, int cc_id) |
Deserialize a network connected component. NN_ID is the univocal identifier of the NN. If any problem occurs, the program will exit with an error. More... | |
void | deserialize_interface (interface *it, char *path, int id, int step) |
Deserialize the interface to the network from a file named "it_STEP.dat", where ID is the univocal identifier of the NN and STEP is the instant in which the interface was saved. If any problem occurs, the program will exit with an error. More... | |
void | deserialize_mea (MEA *mea, char *path, int id, int step) |
Deserialize the MEA of the network from a file named "mea_STEP.nns" where ID is the univocal identifier of the NN and STEP is the instant in which the MEA was saved. If any problem occurs, the program will exit with an error. More... | |
Defines deserialization functions for all the data structures of the library.
This file contains declarations for functions used to deserialize various components of a nanowire network from files. These components include the network's datasheet, topology, state, connected components, interface, and MEA (Multi-Electrode Array). The deserialization process involves reading data from files named according to specific conventions, which include unique identifiers.
void deserialize_component | ( | connected_component * | cc, |
char * | path, | ||
int | nn_id, | ||
int | cc_id | ||
) |
Deserialize a network connected component. NN_ID is the univocal identifier of the NN. If any problem occurs, the program will exit with an error.
cc | The connected component to deserialize. |
path | The base path containing the /device_ID folder. |
nn_id | The univocal id of the network that will determine its folder name. |
cc_id | The index of the connected component. |
void deserialize_interface | ( | interface * | it, |
char * | path, | ||
int | id, | ||
int | step | ||
) |
Deserialize the interface to the network from a file named "it_STEP.dat", where ID is the univocal identifier of the NN and STEP is the instant in which the interface was saved. If any problem occurs, the program will exit with an error.
[out] | it | The interface to set according to the data saved in the file. It has to not be initialized. |
[in] | path | The base path containing 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 deserialize_mea | ( | MEA * | mea, |
char * | path, | ||
int | id, | ||
int | step | ||
) |
Deserialize the MEA of the network from a file named "mea_STEP.nns" where ID is the univocal identifier of the NN and STEP is the instant in which the MEA was saved. If any problem occurs, the program will exit with an error.
[out] | it | The interface to set according to the data saved in the file. It has to not be initialized. |
[in] | path | The base path containing 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 MEA in a specific instant. |
void deserialize_network | ( | datasheet * | ds, |
network_topology * | nt, | ||
char * | path, | ||
int | id | ||
) |
Deserialize the static characteristics of the network from a file named "nanowire_network.ID.dat", where ID is the univocal identifier of the NN. If any problem occurs, the program will exit with an error.
[out] | ds | The datasheet to set according to the data saved in the file. It has to not be initialized. |
[out] | nt | The network topology to set according to the data saved in the file. It has to not be initialized. |
[in] | path | The base path containing the /device_ID folder. |
[in] | id | The univocal id of the network that will determine its file name. |
void deserialize_state | ( | const datasheet | ds, |
const network_topology | nt, | ||
network_state * | ns, | ||
char * | path, | ||
int | id, | ||
int | step | ||
) |
Deserialize the state of the network from a file named "nanowire_state.ID.dat", where ID is the univocal identifier of the NN. If any problem occurs, the program will exit with an error.
[in] | ds | The datasheet of the nanowire network to deserialize. |
[in] | nt | The topology of the nanowire network to deserialize. |
[out] | ns | The network state to set according to the data saved in the file. It has to not be initialized. |
[in] | path | The base path containing 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. |