


#include <stdio.h>
#include <math.h>
#include "listgen.h"

	/* this routine attempts to space out all the targets in its group
	   so that they no longer overlap.  If it can do so, it marks the
	   group as SPARSE; otherwise, it marks the group as OVERFULL. */

expand_group(grp)
struct group *grp;
{
	int i;

	avail_time = grp->end_lst - grp->start_lst; 
	tot_time = 0;
	for (i = grp->start; i < grp->end; i++) {
		tot_time += list[i].exp_time;
	}
	if (tot_time > avail_time) {
		grp->pop_flag = OVERFULL;
	}
	else {
		grp->pop_flag = SPARSE;

		/* in this case, first put all the targets in some arbitrary order,
		   but then call a routine that "optimizes" them so that ones
		   at low Dec get done nearest the meridian (or some such similar
		   rationale. */

		optimize_group(grp);
	}
}

	/* rearrange the targets in a group so that they are observed in the
	   "best" order, where possible criteria are:
	             a. minimizing the air mass, especially for objects which
	                  are far South and will have a large air mass at all times
	             b. minimizing slew time between targets
	*/

optimize_group(grp)
struct group *grp;
{
}

double
group_cost(grp)
struct group *grp;
{
}	
	
