     pattern = Cells.from_rle rle
     analysys = determinePeriod @rule, pattern, 0
     if not analysys.cycle then throw new Error "Pattern #{rle} is not periodic!"
-    console.log "#### add anal: #{JSON.stringify analysys}"
+    #console.log "#### add anal: #{JSON.stringify analysys}"
     [dx,dy,p]=delta=analysys.delta
     unless (dx>0 and dy>=0) or (dx is 0 and dy is 0)
       throw new Error "Pattern #{rle} moves in wrong direction: #{dx},#{dy}"

      Cells.sortXY p
      result.pos = [dx, dy, time]
      result.rle = Cells.to_rle p
      result.found = false
      result.transform = [1,0,0,1]
    return result

    collided: false
  }

### Given the rule and the list of collition products (with their positions)
#   find a moment of time when they emerged.
###
findEmergeTime = (rule, products, minimalTime) ->
  invRule = rule.reverse()
  #Time position of the latest fragment
  maxTime = Math.max (p.pos[2] for p in products)...
  #Prepare all fragments, at time maxTime
  patterns = for product in products
    #console.log "#### Product: #{JSON.stringify product}"
    #first, calculate first space-time point before the maxTime
    initialPos = firstPositionBefore product.pos, product.delta, maxTime
    #Put the pattern at this point
    pattern = Cells.transform product.pattern, product.transform, false
    patternAtTime rule, pattern, initialPos, maxTime

  #console.log "#### Generated #{patterns.length} patterns at time #{maxTime}:"
  #console.log "#### #{normalizedRle [].concat(patterns...)}"
  
  #Now simulate it inverse in time
  invCollision = simulateUntilCollision invRule, patterns, -maxTime+1, -minimalTime
  if not invCollision.collided
    throw new Error "Something is wrong: patterns did not collided in inverse time"
  return -invCollision.time    
  
#simulate patern until it decomposes into several simple patterns
# Return list of collision products
finishCollision = (rule, field, time) ->
