Code Duplication    Length = 34-36 lines in 2 locations

src/main/java/it/cnr/istc/pst/platinum/ai/deliberative/solver/SearchSpaceNode.java 2 locations

@@ 389-424 (lines=36) @@
386
	 * 
387
	 * @return
388
	 */
389
	public double[] getPlanMakespan() {
390
		
391
		// set the makespan
392
		double[] mk = new double[] {
393
				Double.MIN_VALUE + 1,  
394
				Double.MAX_VALUE - 1
395
		};
396
		
397
		
398
		
399
		// set update flag
400
		boolean update = false;
401
		// compute makespan bounds
402
		for (DomainComponent c : this.plan.getMakespan().keySet()) {
403
			// check primitive components only
404
			if (c.getType().equals(DomainComponentType.SV_PRIMITIVE)) {
405
				// update min and max
406
				mk[0] = Math.max(mk[0], this.plan.getMakespan().get(c)[0]);
407
				// update max
408
				mk[1] = Math.min(mk[1], this.plan.getMakespan().get(c)[1]);
409
				// change update flag
410
				update = true;
411
			}
412
		}
413
		
414
		// check update flag
415
		if (!update) {
416
			// set default data 
417
			mk = new double[] {
418
					0, 
419
					Double.MAX_VALUE - 1
420
			};
421
		}
422
		
423
		// get plan makespan 
424
		return mk;
425
	}
426
	
427
	/**
@@ 431-464 (lines=34) @@
428
	 * 
429
	 * @return
430
	 */
431
	public double[] getPlanHeuristicMakespan() {
432
		
433
		// set heuristic makespan
434
		double[] mk = new double[] {
435
				Double.MAX_VALUE - 1,
436
				Double.MIN_VALUE + 1 
437
		};
438
		
439
		// set update flag
440
		boolean update = false;
441
		// check heuristic makespan bounds of components 
442
		for (DomainComponent c : this.heuristicMakespan.keySet()) {
443
			// consider primitive components only 
444
			if (c.getType().equals(DomainComponentType.SV_PRIMITIVE)) {
445
				// update min and max
446
				mk[0] = Math.min(mk[0], this.heuristicMakespan.get(c)[0]);
447
				// update max
448
				mk[1] = Math.max(mk[1], this.heuristicMakespan.get(c)[1]);
449
				// change update flag
450
				update = true;
451
			}
452
		}
453
		
454
		// check update flag
455
		if (!update) {
456
			// set default data 
457
			mk = new double[] {
458
					0, 
459
					Double.MAX_VALUE - 1
460
			};
461
		}
462
		
463
		// get plan makespan 
464
		return mk;
465
	}
466
	
467
	/**