private static void jobshopScheduling() {
		store = new Store();

		Machine[] machines = new Machine[6];

		for (int i = 0; i < machines.length; i++) {
			machines[i] = new Machine(i);
		}
		Job[] jobs = new Job[data.length];

		for (int job = 0; job < jobs.length; job++) {
			jobs[job] = new Job(job);
			int[] row = data[job];

			for (int i = 0; i < row.length; i += 2) {
				Machine m = machines[row[i]];
				int duration = row[i + 1];
				jobs[job].addTask(m, duration, (i / 2) + 1);
			}
			jobs[job].setConstraints();
		}

		for (int i = 0; i < machines.length; i++) {
			machines[i].setConstraints();
		}

		IntVar[] v = vars.toArray(new IntVar[0]);

		IntVar[] lastTimes = new IntVar[jobs.length];
		for (int i = 0; i < jobs.length; i++) {
			lastTimes[i] = jobs[i].getLastEndTime();
		}
		
		IntVar lastJob = new IntVar(store,"lastJob",0,100);
		
		store.impose(new Max(lastTimes,lastJob));
		
		Search<IntVar> search = new DepthFirstSearch<IntVar>();
		
		SelectChoicePoint<IntVar> select = new SimpleSelect<IntVar>(v, 
			    new SmallestDomain<IntVar>(), 
			    new IndomainMin<IntVar>()); 
		
		search.setSolutionListener(new PrintOutListener<IntVar>());
		boolean result = search.labeling(store, select,lastJob);

		if (result) {
			new Graph(machines);
			System.out.println("Solution:");
			for (int i = 0; i < jobs.length; i++) {
				System.out.println(jobs[i]);
			}
			for (int i = 0; i < machines.length; i++) {
				machines[i].printTasks();
			}
			
			System.out.printf("\n\nLast job ends at %d\n",lastJob.value());
		} else
			System.out.println("No solution");

	}