testing things
thinking of how to display the ants moving and optimise by moving at least one on each path
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: mndhlovu <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2019/03/25 06:31:05 by mndhlovu #+# #+# */
|
||||
/* Updated: 2019/04/05 13:43:21 by tmaze ### ########.fr */
|
||||
/* Updated: 2019/04/05 14:40:50 by tmaze ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -30,7 +30,7 @@ int main(int ac, char **av)
|
||||
t_lmdata ldata;
|
||||
t_holder holder;
|
||||
int fd;
|
||||
t_list *it;
|
||||
t_node *it;
|
||||
t_node *start;
|
||||
t_node *end;
|
||||
|
||||
@@ -44,17 +44,23 @@ int main(int ac, char **av)
|
||||
{
|
||||
//validation works
|
||||
ft_printf("Success\n");
|
||||
it = ldata.nodes;
|
||||
while (it && ((t_node*)(it->content))->role != 's')
|
||||
ft_printf("=== ldata ===\nnbants: %d\nnb_nodes: %d\nnodes: %p\nnodes_data: %p\nadj: %d\n\n", ldata.nbants, ldata.nb_nodes, ldata.nodes, ldata.nodes_data, ldata.adj);
|
||||
it = ldata.nodes_data;
|
||||
while (it && it->role != 's')
|
||||
{
|
||||
ft_printf("=== node ===\nindex: %d\nrole: %c\n\n", ((t_node*)(it->content))->ind, ((t_node*)(it->content))->role);
|
||||
ft_printf("=== node ===\nindex: %d\nrole: %c\n\n", it->ind, it->role);
|
||||
it = it->next;
|
||||
}
|
||||
start = it->content;
|
||||
it = ldata.nodes;
|
||||
while (it && ((t_node*)(it->content))->role != 'e')
|
||||
ft_printf("=== node ===\nindex: %d\nrole: %c\n\n", it->ind, it->role);
|
||||
start = it;
|
||||
it = ldata.nodes_data;
|
||||
while (it && it->role != 'e')
|
||||
{
|
||||
ft_printf("=== node ===\nindex: %d\nrole: %c\n\n", it->ind, it->role);
|
||||
it = it->next;
|
||||
end = it->content;
|
||||
}
|
||||
ft_printf("=== node ===\nindex: %d\nrole: %c\n\n", it->ind, it->role);
|
||||
end = it;
|
||||
edmunds_karp(&ldata, start->ind, end->ind);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user