@CLNames(names ={ "-ema" })
	@CLUsage("time npop m11 m12 ...")
	@CLDescription("set the migration matrix at a given time. Effects propergate pastward. Note that the correct number of demes for the time must be specified")
	public void addTimeMigrationMatrix(double time, int npop, String[] mat) {
		if (!flagI) {
			throw new RuntimeException("setting deme parameters when no deme sampling has been specified (ie -I option)");
		}
		if (npop * npop != mat.length) {
			throw new RuntimeException("not enough arguments for migration matrix. Remeber that diagonal entrys are required, but ignored");
		}
		long t =Math.round(time * 4 * N0);
		double[][] rates =new double[npop][npop];
		int index =0;
		for (int i =0; i < npop; i++) {
			for (int j =0; j < npop; j++) {
				String s =mat[index++];
				if (i == j)
					continue;
				if(s.matches("^[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?$"))//double regex...matchs floats and doubles
					rates[i][j] =Double.parseDouble(s) / (4 * N0);
			}
		}
		events.add(new MigrationMatrixEvent(t, rates));
		if(time!=0)
		timeInvarient =false;
	}