Code Duplication    Length = 26-26 lines in 2 locations

src/main/java/it/cnr/istc/pst/platinum/ai/framework/microkernel/resolver/timeline/behavior/planning/TimelineBehaviorPlanningResolver.java 2 locations

@@ 440-465 (lines=26) @@
437
								transition.add(solution.getRightDecision());
438
								
439
								// create relations needed to enforce the transition
440
								for (int index = 0; index < transition.size() - 1; index++) 
441
								{
442
									// get adjacent decisions
443
									Decision reference = transition.get(index);
444
									Decision target = transition.get(index + 1);
445
									
446
									// create pending relation
447
									MeetsRelation meets = this.component.create(RelationType.MEETS, reference, target);
448
									// add created relation
449
									solution.addCreatedRelation(meets);
450
									// activate relation if possible
451
									if (this.component.activate(meets)) {
452
										// add to activated relations
453
										solution.addActivatedRelation(meets);
454
									}
455
									
456
									// create parameter relations
457
									Set<Relation> pRels = this.createParameterRelations(reference, target);
458
									// check relations
459
									for (Relation prel : pRels) {
460
										// add relation to solution
461
										solution.addCreatedRelation(prel);
462
										// activate relation if possible
463
										if (this.component.activate(prel)) {
464
											// add to activated relations
465
											solution.addActivatedRelation(prel);
466
										}
467
									}
468
								}
@@ 177-202 (lines=26) @@
174
				transition.add(completion.getRightDecision());
175
				
176
				// create relations needed to enforce the transition
177
				for (int index = 0; index < transition.size() - 1; index++) 
178
				{
179
					// get adjacent decisions
180
					Decision reference = transition.get(index);
181
					Decision target = transition.get(index + 1);
182
					
183
					// create pending relation
184
					MeetsRelation meets = this.component.create(RelationType.MEETS, reference, target);
185
					// add created relation
186
					solution.addCreatedRelation(meets);
187
					// activate relation if possible
188
					if (this.component.activate(meets)) {
189
						// add to activated relations
190
						solution.addActivatedRelation(meets);
191
					}
192
						
193
					// create parameter relations
194
					Set<Relation> pRels = this.createParameterRelations(reference, target);
195
					// check relations
196
					for (Relation prel : pRels) {
197
						// add relation to solution
198
						solution.addCreatedRelation(prel);
199
						// activate relation if possible
200
						if (this.component.activate(prel)) {
201
							// add to activated relations
202
							solution.addActivatedRelation(prel);
203
						}
204
					}
205
				}