net_bn* CopyNet_bn ( const net_bn*  net,   const char*  new_name,   environ_ns*  new_env,   const char*  control )

Duplicates net, giving the new net the name new_name and placing it in the environment new_env. Returns the new net.

The name of the new net will be new_name. It must be a legal IDname, which means it must have NAME_MAX_ns (30) or fewer characters, all of which are letters, digits or underscores, and it must start with a letter. Netica will make a copy of new_name; it won't modify or free the passed string.

control allows you to control what gets copied. It can be "no_tables", "no_visual", or both separated by a comma. Including "no_tables" means that the CPT, functional, and experience tables will not be copied. Including "no_visual" means that none of the visual-display details of the net and its nodes will be copied.

The user fields of net and its nodes will be copied to the new net (see SetNetUserField_bn and SetNodeUserField_bn), but the user data of the new net and new nodes in that net will be set to NULL (see SetNetUserData_bn and SetNodeUserData_bn).

When you are done with the new net, you should pass it to DeleteNet_bn.

If you just wish to duplicate one or more nodes, see CopyNodes_bn. For other, more fine-grained control over the copying process, you may want to write your own duplicating function, in which case the NeticaEx function DuplicateNet may be a useful model.

Version:

In version 3.05 and later.
Versions 2.28 through 3.04 had a function called DuplicateNet_bn.
NeticaEx has a similar function called DuplicateNet.

See also:

CopyNodes_bn    Just duplicate some of the nodes in the net.

Example:

// This will duplicate net1's structure, but will not copy its CPT, functional,
// or experience tables.

net_bn* net2 = CopyNet_bn ( net1, "net2", env, "no_tables" );