Commit 4601f4e3 authored by Gaurav Saxena's avatar Gaurav Saxena
Browse files

Project BEFORE changing SOLVER

parents
/*
#############################################################################
# If you use BioFVM in your project, please cite BioFVM and the version #
# number, such as below: #
# #
# We solved the diffusion equations using BioFVM (Version 1.1.6) [1] #
# #
# [1] A. Ghaffarizadeh, S.H. Friedman, and P. Macklin, BioFVM: an efficient #
# parallelized diffusive transport solver for 3-D biological simulations,#
# Bioinformatics 32(8): 1256-8, 2016. DOI: 10.1093/bioinformatics/btv730 #
# #
#############################################################################
# #
# BSD 3-Clause License (see https://opensource.org/licenses/BSD-3-Clause) #
# #
# Copyright (c) 2015-2017, Paul Macklin and the BioFVM Project #
# All rights reserved. #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions are #
# met: #
# #
# 1. Redistributions of source code must retain the above copyright notice, #
# this list of conditions and the following disclaimer. #
# #
# 2. Redistributions in binary form must reproduce the above copyright #
# notice, this list of conditions and the following disclaimer in the #
# documentation and/or other materials provided with the distribution. #
# #
# 3. Neither the name of the copyright holder nor the names of its #
# contributors may be used to endorse or promote products derived from this #
# software without specific prior written permission. #
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS #
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED #
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A #
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER #
# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, #
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, #
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR #
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF #
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING #
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS #
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #
# #
#############################################################################
*/
#ifndef __BioFVM_h__
#define __BioFVM_h__
#include <iostream>
#include <fstream>
namespace BioFVM{
extern std::string BioFVM_Version;
extern std::string BioFVM_URL;
};
#include "BioFVM_utilities.h"
#include "BioFVM_vector.h"
#include "BioFVM_vector.h"
#include "BioFVM_mesh.h"
#include "BioFVM_microenvironment.h"
#include "BioFVM_solvers.h"
#include "BioFVM_basic_agent.h"
#endif
This diff is collapsed.
/*
#############################################################################
# If you use BioFVM in your project, please cite BioFVM and the version #
# number, such as below: #
# #
# We solved the diffusion equations using BioFVM (Version 1.1.6) [1] #
# #
# [1] A. Ghaffarizadeh, S.H. Friedman, and P. Macklin, BioFVM: an efficient #
# parallelized diffusive transport solver for 3-D biological simulations,#
# Bioinformatics 32(8): 1256-8, 2016. DOI: 10.1093/bioinformatics/btv730 #
# #
#############################################################################
# #
# BSD 3-Clause License (see https://opensource.org/licenses/BSD-3-Clause) #
# #
# Copyright (c) 2015-2017, Paul Macklin and the BioFVM Project #
# All rights reserved. #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions are #
# met: #
# #
# 1. Redistributions of source code must retain the above copyright notice, #
# this list of conditions and the following disclaimer. #
# #
# 2. Redistributions in binary form must reproduce the above copyright #
# notice, this list of conditions and the following disclaimer in the #
# documentation and/or other materials provided with the distribution. #
# #
# 3. Neither the name of the copyright holder nor the names of its #
# contributors may be used to endorse or promote products derived from this #
# software without specific prior written permission. #
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS #
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED #
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A #
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER #
# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, #
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, #
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR #
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF #
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING #
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS #
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #
# #
#############################################################################
*/
#ifndef __BioFVM_MultiCellDS_h__
#define __BioFVM_MultiCellDS_h__
#include "pugixml.hpp"
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <ctime>
#include <cstring>
#include <vector>
#include <fstream>
namespace BioFVM{
extern std::string MultiCellDS_version_string;
extern std::string MultiCellDS_clinical_snapshot_type_string;
extern int MultiCellDS_clinical_snapshot_code;
extern std::string MultiCellDS_experimental_snapshot_type_string;
extern int MultiCellDS_experimental_snapshot_code;
extern std::string MultiCellDS_simulation_snapshot_type_string;
extern int MultiCellDS_simulation_snapshot_code;
extern std::string MultiCellDS_digital_cell_line_type_string;
extern int MultiCellDS_digital_cell_line_code;
/* options */
extern bool save_mesh_as_matlab;
extern bool save_density_data_as_matlab;
extern bool save_cells_as_custom_matlab;
extern bool save_cell_data;
class Microenvironment;
extern pugi::xml_document biofvm_doc;
class Person_Metadata
{
private:
bool is_empty;
public:
std::string type; // author, creator, user, curator
std::string surname;
std::string given_names;
std::string email;
std::string URL;
std::string organization;
std::string department;
std::string ORCID;
Person_Metadata( );
void display_information( std::ostream& os );
void insert_in_open_xml_pugi( pugi::xml_node& insert_here );
};
class Citation_Metadata
{
private:
public:
std::string DOI;
std::string PMID;
std::string PMCID;
std::string text;
std::string notes;
std::string URL;
Citation_Metadata();
void display_information( std::ostream& os );
void insert_in_open_xml_pugi( pugi::xml_node& insert_here );
};
class Software_Metadata
{
private:
public:
// basic program information
std::string program_name;
std::string program_version;
std::string program_URL;
Person_Metadata creator;
Person_Metadata user;
Citation_Metadata citation;
Software_Metadata();
void display_information( std::ostream& os );
void insert_in_open_xml_pugi( pugi::xml_node& insert_here );
};
class MultiCellDS_Metadata
{
private:
public:
std::string MultiCellDS_type;
Software_Metadata program;
Citation_Metadata data_citation;
// scientific information
std::string spatial_units;
std::string time_units;
std::string runtime_units;
double current_time;
double current_runtime;
std::string description; // any optional text -- not implemented
MultiCellDS_Metadata();
void display_information( std::ostream& os);
void sync_to_microenvironment( Microenvironment& M );
void restart_runtime( void );
void add_to_open_xml_pugi( double current_simulation_time, pugi::xml_document& xml_dom );
};
extern MultiCellDS_Metadata BioFVM_metadata;
/* setting up the main MultiCellDS tree structure */
void add_MultiCellDS_main_structure_to_open_xml_pugi( pugi::xml_document& xml_dom );
/* set options */
void set_save_biofvm_mesh_as_matlab( bool newvalue ); // default: true
void set_save_biofvm_data_as_matlab( bool newvalue ); // default: true
void set_save_biofvm_cell_data( bool newvalue ); // default: true
void set_save_biofvm_cell_data_as_custom_matlab( bool newvalue ); // default: true
/* writing parts of BioFVM to a MultiCellDS file */
void add_BioFVM_substrates_to_open_xml_pugi( pugi::xml_document& xml_dom , std::string filename_base , Microenvironment& M );
void add_BioFVM_basic_agent_to_open_xml_pugi( pugi::xml_document& xml_dom, Basic_Agent& BA ); // not implemented -- future edition
void add_BioFVM_agents_to_open_xml_pugi( pugi::xml_document& xml_dom, std::string filename_base, Microenvironment& M );
void add_BioFVM_to_open_xml_pugi( pugi::xml_document& xml_dom , std::string filename_base, double current_simulation_time , Microenvironment& M );
void save_BioFVM_to_MultiCellDS_xml_pugi( std::string filename_base , Microenvironment& M , double current_simulation_time);
/* future / not yet supported */
void read_BioFVM_from_open_xml_pugi( pugi::xml_document& xml_dom , std::string filename_base, double& current_simulation_time , Microenvironment& M );
void read_BioFVM_to_MultiCellDS_xml_pugi( std::string filename_base , Microenvironment& M , double& current_simulation_time );
/* partly-implemented code snippets -- not to be used as of March 2016 */
// functions to read multiscale_microenvironment from MultiCellDS file (requires pugixml)
void read_microenvironment_from_MultiCellDS_xml( Microenvironment& M_destination , std::string filename );
void read_microenvironment_from_MultiCellDS_xml( Microenvironment& M_destination , pugi::xml_document& xml_dom );
};
#endif
/*
#############################################################################
# If you use BioFVM in your project, please cite BioFVM and the version #
# number, such as below: #
# #
# We solved the diffusion equations using BioFVM (Version 1.1.6) [1] #
# #
# [1] A. Ghaffarizadeh, S.H. Friedman, and P. Macklin, BioFVM: an efficient #
# parallelized diffusive transport solver for 3-D biological simulations,#
# Bioinformatics 32(8): 1256-8, 2016. DOI: 10.1093/bioinformatics/btv730 #
# #
#############################################################################
# #
# BSD 3-Clause License (see https://opensource.org/licenses/BSD-3-Clause) #
# #
# Copyright (c) 2015-2017, Paul Macklin and the BioFVM Project #
# All rights reserved. #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions are #
# met: #
# #
# 1. Redistributions of source code must retain the above copyright notice, #
# this list of conditions and the following disclaimer. #
# #
# 2. Redistributions in binary form must reproduce the above copyright #
# notice, this list of conditions and the following disclaimer in the #
# documentation and/or other materials provided with the distribution. #
# #
# 3. Neither the name of the copyright holder nor the names of its #
# contributors may be used to endorse or promote products derived from this #
# software without specific prior written permission. #
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS #
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED #
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A #
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER #
# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, #
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, #
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR #
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF #
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING #
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS #
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #
# #
#############################################################################
*/
#include "BioFVM_agent_container.h"
#include "BioFVM_basic_agent.h"
#include "BioFVM_vector.h"
namespace BioFVM{
Agent_Container::Agent_Container(){}
void Agent_Container::initialize(int num_voxels){}
void Agent_Container::register_agent( Basic_Agent* agent ){}
void Agent_Container::remove_agent(Basic_Agent* agent ){}
void Agent_Container::add_agent_to_outer_voxel(Basic_Agent* agent){}
void Agent_Container::remove_agent_from_voxel(Basic_Agent* agent, int voxel_index){}
void Agent_Container::add_agent_to_voxel(Basic_Agent* agent, int voxel_index){}
void Agent_Container::update_all_cells(double dt){}
};
\ No newline at end of file
/*
#############################################################################
# If you use BioFVM in your project, please cite BioFVM and the version #
# number, such as below: #
# #
# We solved the diffusion equations using BioFVM (Version 1.1.6) [1] #
# #
# [1] A. Ghaffarizadeh, S.H. Friedman, and P. Macklin, BioFVM: an efficient #
# parallelized diffusive transport solver for 3-D biological simulations,#
# Bioinformatics 32(8): 1256-8, 2016. DOI: 10.1093/bioinformatics/btv730 #
# #
#############################################################################
# #
# BSD 3-Clause License (see https://opensource.org/licenses/BSD-3-Clause) #
# #
# Copyright (c) 2015-2017, Paul Macklin and the BioFVM Project #
# All rights reserved. #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions are #
# met: #
# #
# 1. Redistributions of source code must retain the above copyright notice, #
# this list of conditions and the following disclaimer. #
# #
# 2. Redistributions in binary form must reproduce the above copyright #
# notice, this list of conditions and the following disclaimer in the #
# documentation and/or other materials provided with the distribution. #
# #
# 3. Neither the name of the copyright holder nor the names of its #
# contributors may be used to endorse or promote products derived from this #
# software without specific prior written permission. #
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS #
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED #
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A #
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER #
# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, #
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, #
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR #
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF #
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING #
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS #
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #
# #
#############################################################################
*/
#ifndef __BioFVM_agent_container_h__
#define __BioFVM_agent_container_h__
#include <vector>
namespace BioFVM{
class Basic_Agent;
class Microenvironment;
class Agent_Container
{
private:
public:
std::vector<std::vector<Basic_Agent*> > agent_grid;
Agent_Container();
void register_agent( Basic_Agent* agent );
void initialize( int num_voxels );
void remove_agent(Basic_Agent* agent );
void add_agent_to_outer_voxel(Basic_Agent* agent);
void remove_agent_from_voxel(Basic_Agent* agent, int voxel_index);
void add_agent_to_voxel(Basic_Agent* agent, int voxel_index);
void update_all_cells(double dt);
};
int find_escaping_face_index(Basic_Agent* agent);
};
#endif
/*
#############################################################################
# If you use BioFVM in your project, please cite BioFVM and the version #
# number, such as below: #
# #
# We solved the diffusion equations using BioFVM (Version 1.1.6) [1] #
# #
# [1] A. Ghaffarizadeh, S.H. Friedman, and P. Macklin, BioFVM: an efficient #
# parallelized diffusive transport solver for 3-D biological simulations,#
# Bioinformatics 32(8): 1256-8, 2016. DOI: 10.1093/bioinformatics/btv730 #
# #
#############################################################################
# #
# BSD 3-Clause License (see https://opensource.org/licenses/BSD-3-Clause) #
# #
# Copyright (c) 2015-2017, Paul Macklin and the BioFVM Project #
# All rights reserved. #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions are #
# met: #
# #
# 1. Redistributions of source code must retain the above copyright notice, #
# this list of conditions and the following disclaimer. #
# #
# 2. Redistributions in binary form must reproduce the above copyright #
# notice, this list of conditions and the following disclaimer in the #
# documentation and/or other materials provided with the distribution. #
# #
# 3. Neither the name of the copyright holder nor the names of its #
# contributors may be used to endorse or promote products derived from this #
# software without specific prior written permission. #
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS #
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED #
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A #
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER #
# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, #
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, #
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR #
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF #
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING #
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS #
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #
# #
#############################################################################
*/
#include "BioFVM_basic_agent.h"
#include "BioFVM_agent_container.h"
#include "BioFVM_vector.h"
namespace BioFVM{
std::vector<Basic_Agent*> all_basic_agents(0);
Basic_Agent::Basic_Agent()
{
/*-----------------------------------------------------------------------------------------------------*/
/* give the agent a unique ID - but now there is no need for this as */
/* the ID is being generated in create_sources() or create_sinks() functions */
/* but if an agent is created directly i.e. Basic_Agent x = new Basic_Agent; */
/* then there will be a problem ! */
/* eepecially at non-root processes ! */
/*-----------------------------------------------------------------------------------------------------*/
static int max_basic_agent_ID = 0;
ID = max_basic_agent_ID; //
max_basic_agent_ID++;
is_active=true;
volume = 1.0;
position.assign( 3 , 0.0 ); // initialize position and velocity
velocity.assign( 3 , 0.0 );
previous_velocity.assign( 3 , 0.0 );
// link into the microenvironment, if one is defined
secretion_rates= new std::vector<double>(0);
uptake_rates= new std::vector<double>(0);
saturation_densities= new std::vector<double>(0);
extern Microenvironment* default_microenvironment;
register_microenvironment( default_microenvironment );
return;
}
void Basic_Agent::update_position(double dt){
//make sure to update current_voxel_index if you are implementing this function
};
bool Basic_Agent::assign_position(std::vector<double> new_position, int mpi_Rank, int *mpi_Dims) //-->Gaurav Saxena
{
return assign_position(new_position[0], new_position[1], new_position[2], mpi_Rank, mpi_Dims);
}
bool Basic_Agent::assign_position(double x, double y, double z, int mpi_Rank, int *mpi_Dims)
{
// std::cout << __FILE__ << " " << __LINE__ << std::endl;
if( !get_microenvironment()->mesh.is_position_valid(x,y,z)) //No need to parallelize is_position_valid(x,y,z) - it will work for parallel implementation
{
// std::cout<<"Error: the new position for agent "<< ID << " is invalid: "<<x<<","<<y<<","<<"z"<<std::endl;
return false;
}
position[0]=x;
position[1]=y;
position[2]=z;
update_voxel_index(mpi_Rank, mpi_Dims);
// make sure the agent is not already registered
get_microenvironment()->agent_container->register_agent(this);
return true;
}
void Basic_Agent::update_voxel_index(int mpi_Rank, int *mpi_Dims)
{
if( !get_microenvironment()->mesh.is_position_valid(position[0],position[1],position[2]))
{
current_voxel_index=-1;
is_active=false;
return;
}
current_voxel_index= microenvironment->nearest_voxel_local_index( position, mpi_Rank, mpi_Dims );
}
void Basic_Agent::set_internal_uptake_constants( double dt )
{
// overall form: dp/dt = S*(T-p) - U*p
// p(n+1) - p(n) = dt*S(n)*T(n) - dt*( S(n) + U(n))*p(n+1)
// p(n+1)*temp2 = p(n) + temp1
// p(n+1) = ( p(n) + temp1 )/temp2
//int nearest_voxel= current_voxel_index;
double internal_constant_to_discretize_the_delta_approximation = dt * volume / ( (microenvironment->voxels(current_voxel_index)).volume ) ; // needs a fix
// temp1 = dt*(V_cell/V_voxel)*S*T
cell_source_sink_solver_temp1.assign( (*secretion_rates).size() , 0.0 );
cell_source_sink_solver_temp1 += *secretion_rates;
cell_source_sink_solver_temp1 *= *saturation_densities;
cell_source_sink_solver_temp1 *= internal_constant_to_discretize_the_delta_approximation;
// temp2 = 1 + dt*(V_cell/V_voxel)*( S + U )
cell_source_sink_solver_temp2.assign( (*secretion_rates).size() , 1.0 );
axpy( &(cell_source_sink_solver_temp2) , internal_constant_to_discretize_the_delta_approximation , *secretion_rates );
axpy( &(cell_source_sink_solver_temp2) , internal_constant_to_discretize_the_delta_approximation , *uptake_rates );
volume_is_changed = false;
}
void Basic_Agent::register_microenvironment( Microenvironment* microenvironment_in )
{
microenvironment = microenvironment_in;
secretion_rates->resize( microenvironment->density_vector(0).size() , 0.0 );
saturation_densities->resize( microenvironment->density_vector(0).size() , 0.0 );
uptake_rates->resize( microenvironment->density_vector(0).size() , 0.0 );
// some solver temporary variables
cell_source_sink_solver_temp1.resize( microenvironment->density_vector(0).size() , 0.0 );
cell_source_sink_solver_temp2.resize( microenvironment->density_vector(0).size() , 1.0 );
return;
}
Microenvironment* Basic_Agent::get_microenvironment( void )
{ return microenvironment; }
Basic_Agent::~Basic_Agent()
{
return;
}
Basic_Agent* create_basic_agent( void )
{
Basic_Agent* pNew;
pNew = new Basic_Agent;
all_basic_agents.push_back( pNew );
pNew->index=all_basic_agents.size()-1; //index is local to this process
return pNew;
}
void delete_basic_agent( int index )
{
// deregister agent in microenvironment
all_basic_agents[index]->get_microenvironment()->agent_container->remove_agent(all_basic_agents[index]);
// de-allocate (delete) the Basic_Agent;
delete all_basic_agents[index];
// next goal: remove this memory address.