// Path: library/src/main/java/no/agens/cassowarylayout/util/MeasureSpecUtils.java
// public class MeasureSpecUtils {
//     public static String getModeAsString(int modeOrSpec) {
//         String modeAsString;
//         int mode = View.MeasureSpec.getMode(modeOrSpec);
//         if (mode == View.MeasureSpec.EXACTLY) {
//             modeAsString = "EXACTLY";
//         } else if (mode == View.MeasureSpec.AT_MOST) {
//             modeAsString = "AT_MOST";
//         } else if (mode == View.MeasureSpec.UNSPECIFIED) {
//             modeAsString = "UNSPECIFIED";
//         } else {
//             modeAsString = "unknown mode " + modeOrSpec;
//         }
// 
//         return modeAsString;
//     }
// }
// 
// Path: library/src/main/java/no/agens/cassowarylayout/util/TimerUtil.java
// public class TimerUtil {
//     public static long since(long since) {
//         return (System.nanoTime() - since) / 1000000;
//     }
// }


import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import no.agens.cassowarylayout.util.MeasureSpecUtils;
import no.agens.cassowarylayout.util.TimerUtil;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Handler;
import android.os.Looper;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
        this.aspectRatioHeightFactor = aspectRatioHeightFactor;
    }

    public void setChildPositionsFromCassowaryModel() {
        long timeBeforeSolve = System.nanoTime();
        int count = getChildCount();
        for (int i = 0; i < count; i++) {
            View child = getChildAt(i);
            if (child.getVisibility() != GONE) {

                int childId = child.getId();

                Node node = getNodeById(childId);

                int x = (int) node.getLeft().value() + getPaddingLeft();
                int y = (int) node.getTop().value() + getPaddingTop();

                child.setX(x);
                child.setY(y);

            }
        }
        log("setChildPositionsFromCassowaryModel - took " + TimerUtil.since(timeBeforeSolve));
    }

    @Override
    protected void onMeasure(final int widthMeasureSpec, final int heightMeasureSpec) {
        long before = System.nanoTime();

        log("onMeasure width " +
// Path: library/src/main/java/no/agens/cassowarylayout/util/MeasureSpecUtils.java
// public class MeasureSpecUtils {
//     public static String getModeAsString(int modeOrSpec) {
//         String modeAsString;
//         int mode = View.MeasureSpec.getMode(modeOrSpec);
//         if (mode == View.MeasureSpec.EXACTLY) {
//             modeAsString = "EXACTLY";
//         } else if (mode == View.MeasureSpec.AT_MOST) {
//             modeAsString = "AT_MOST";
//         } else if (mode == View.MeasureSpec.UNSPECIFIED) {
//             modeAsString = "UNSPECIFIED";
//         } else {
//             modeAsString = "unknown mode " + modeOrSpec;
//         }
// 
//         return modeAsString;
//     }
// }
// 
// Path: library/src/main/java/no/agens/cassowarylayout/util/TimerUtil.java
// public class TimerUtil {
//     public static long since(long since) {
//         return (System.nanoTime() - since) / 1000000;
//     }
// }


// Path: library/src/main/java/no/agens/cassowarylayout/CassowaryLayout.java
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import no.agens.cassowarylayout.util.MeasureSpecUtils;
import no.agens.cassowarylayout.util.TimerUtil;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Handler;
import android.os.Looper;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;

        this.aspectRatioHeightFactor = aspectRatioHeightFactor;
    }

    public void setChildPositionsFromCassowaryModel() {
        long timeBeforeSolve = System.nanoTime();
        int count = getChildCount();
        for (int i = 0; i < count; i++) {
            View child = getChildAt(i);
            if (child.getVisibility() != GONE) {

                int childId = child.getId();

                Node node = getNodeById(childId);

                int x = (int) node.getLeft().value() + getPaddingLeft();
                int y = (int) node.getTop().value() + getPaddingTop();

                child.setX(x);
                child.setY(y);

            }
        }
        log("setChildPositionsFromCassowaryModel - took " + TimerUtil.since(timeBeforeSolve));
    }

    @Override
    protected void onMeasure(final int widthMeasureSpec, final int heightMeasureSpec) {
        long before = System.nanoTime();

        log("onMeasure width " +
                MeasureSpecUtils.getModeAsString(widthMeasureSpec) + " " +