Phil 8.29.17

7:00 – 6:30 ASRC Research

  • Probably not going to get the StorageAndRetreival class done and integrated by Sept 1, so I’ll need to work out the paper based on what I have. But let’s see how far we get…
  • I think I’m going to start simply by placing the agent type in the IR cell and color accordingly. There will be three states, NULL (white) , EXPLORE (red) and EXPLOIT (green)
  • Fixing some things along the way. Stage dimension initial size was hard coded. Oops.
  • Adding a clear() to LabeledTensor and StorageAndRetreival
  • Working out how to recurse though a set of arrays. Putting here for later reference:
    class Recurse{
        int linecount = 0;
    
        boolean fillMat(int[] curIndices, int[] maxIndices, int curIndex){
            if(curIndex > curIndices.length-1){
                //System.out.printf("curIndex(%d) > %d\n", curIndex, curIndices.length-1);
                return true;
            }
            for(int i = 0; i < maxIndices[curIndex]; ++i) {
                curIndices[curIndex] = i;
                boolean done = fillMat(curIndices, maxIndices, curIndex+1);
                if(done) {
                    linecount++;
                    System.out.println(linecount+" [" + curIndex + "]: " + Arrays.toString(curIndices) + " = " + done);
                }
            }
            return false;
        }
    
        public static void main(String[] args){
            int[] initial = {0, 0, 0};
            int[] max = {3, 3, 3};
            System.out.println("Recurse!");
            Recurse r = new Recurse();
            r.fillMat(initial, max, 0);
        }
    }
  • Here’s the final version, with an Interface callback
    public boolean fillTensor(int[] curIndices, int[] maxIndices, int curIndex, TensorCellEvaluator tce){
        if(curIndex > curIndices.length-1){
            // if we get here, we're done
            return true;
        }
        for(int i = 0; i < maxIndices[curIndex]; ++i) {
            curIndices[curIndex] = i;
            boolean done = fillTensor(curIndices, maxIndices, curIndex+1, tce);
            if(done) {
                tce.evaluate(curIndices, lt);
            }
        }
        // if we get here, we're not none, keep going
        return false;
    }
  • Here’s the call with the implemented interface. It doesn’t do anything yet, but the pieces all work
    stoRet.fillTensor(indicies, maxIndicies, 0, new TensorCellEvaluator() {
        @Override
        public String evaluate(int[] indicies, LabeledTensor lt) {
            System.out.println(Arrays.toString(indicies));
            return Arrays.toString(indicies);
        }
    });
  • Interview with USDA team. Not a fit at all

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.