| | |
| | | #include "vertex.h" |
| | | #include "cell.h" |
| | | char plugin_name[] = "Default hard constraints for vertex move"; |
| | | char plugin_description[]= "Checks proximity with neighbors and with foreign vertices"; |
| | | char plugin_description[]= "Checks proximity with neighbors, vertices in neighboring cells and with foreign vertices that may be in vicinity"; |
| | | char plugin_author[] = "SAMO PENIC"; |
| | | |
| | | ts_plugin_details *init (){ |
| | | // ts_fprintf(stdout,"Hello. Plugin %s is initiating. This will load the details section of the plugin\n", plugin_name); |
| | | |
| | | ts_plugin_details *details=(ts_plugin_details *)calloc(1,sizeof(ts_plugin_details)); |
| | | details->name = plugin_name; |
| | | return details; |
| | | } |
| | | |
| | | void at_start(int argc, char **argv){ |
| | | } |
| | | |
| | | void *after_vesicle_init(ts_vesicle *vesicle){ |
| | | ts_fprintf(stdout,"Plugin \"%s\" is loaded.\n", plugin_name); |
| | | return vesicle; |
| | | } |
| | | |
| | | ts_bool vm_hard_constraint(ts_vesicle *vesicle, ts_vertex *vtx, ts_vertex *ovtx){ |
| | |
| | | ts_uint cellidx; |
| | | ts_double dist; |
| | | ts_bool retval; |
| | | |
| | | //distance with neighbours check |
| | | for(i=0;i<vtx->neigh_no;i++){ |
| | | dist=vtx_distance_sq(vtx,vtx->neigh[i]); |
| | |
| | | return TS_SUCCESS; |
| | | } |
| | | |
| | | void cleanup(){ |
| | | ts_fprintf(stdout,"Goodbye from plugin %s. This functions clears what would be created in init...\n",plugin_name); |
| | | } |