Examples of Fragment


Examples of amidst.map.Fragment

    if (player.parentFragment != null) {
      player.parentFragment.removeObject(player);
    }
    Point location = map.screenToLocal(mapViewer.lastRightClick);
    player.setPosition(location.x, location.y);
    Fragment fragment = map.getFragmentAt(location);
    fragment.addObject(player);
    player.parentFragment = fragment;
  }
View Full Code Here

Examples of com.asakusafw.compiler.flow.stage.StageModel.Fragment

            // rendezvous
            for (ReduceUnit unit : reduceUnits) {
                if (unit.canCombine() == false) {
                    continue;
                }
                Fragment first = unit.getFragments().get(0);
                SimpleName rendezvousName = names.create("combine");
                rendezvousNames.put(first, rendezvousName);
                fields.add(factory.newFieldDeclaration(
                        null,
                        new AttributeBuilder(factory)
                            .Private()
                            .toAttributes(),
                        importer.toType(first.getCompiled().getQualifiedName()),
                        rendezvousName,
                        null));
            }
            return fields;
        }
View Full Code Here

Examples of com.asakusafw.compiler.flow.stage.StageModel.Fragment

                segments.put(segment.getPort(), segment);
            }

            // rendezvous
            for (Map.Entry<Fragment, SimpleName> entry : rendezvousNames.entrySet()) {
                Fragment fragment = entry.getKey();
                Type rendezvousType = importer.toType(fragment.getCompiled().getQualifiedName());
                List<Expression> arguments = Lists.create();
                for (FlowElementInput input : fragment.getInputPorts()) {
                    Segment segment = segments.get(input);
                    assert segment != null;
                    SimpleName shuffleName = shuffleNames.get(segment);
                    assert shuffleName != null;
                    arguments.add(new ExpressionBuilder(factory, factory.newThis())
View Full Code Here

Examples of com.asakusafw.compiler.flow.stage.StageModel.Fragment

                if (saw.contains(node)) {
                    continue;
                }
                saw.add(node);
                graph.addNode(node);
                Fragment fragment = (Fragment) node.getValue();
                for (FlowElementInput input : fragment.getInputPorts()) {
                    for (FlowElementOutput pred : input.getOpposites()) {
                        List<FragmentNode> sources = nodes.get(pred);
                        if (sources == null) {
                            continue;
                        }
View Full Code Here

Examples of com.asakusafw.compiler.flow.stage.StageModel.Fragment

        environment.getOptions().setEnableCombiner(combine);
        List<StageModel> stages = compile(SummarizeFlowTrivial.class);
        StageModel stage = stages.get(0);
        Assume.assumeThat(stage.getReduceUnits().size(), is(1));
        ReduceUnit reduce = stage.getReduceUnits().get(0);
        Fragment fragment = reduce.getFragments().get(0);
        Name name = fragment.getCompiled().getQualifiedName();

        ClassLoader loader = start();
        PortMapper mapper = new PortMapper(fragment);
        MockResult<ExSummarized> result = mapper.create("out");

        @SuppressWarnings("unchecked")
        Rendezvous<Writable> f = (Rendezvous<Writable>) create(loader, name, mapper.toArguments());

        Segment segment = stage.getShuffleModel().findSegment(fragment.getInputPorts().get(0));
        SegmentedWritable value = createShuffleValue(loader, stage);

        ExSummarized ex1 = new ExSummarized();
        ex1.setCount(1);
        f.begin();
View Full Code Here

Examples of com.asakusafw.compiler.flow.stage.StageModel.Fragment

     * 自明な構造を持つテスト。
     */
    @Test
    public void trivial() {
        List<StageModel> stages = compile(SplitFlowTrivial.class);
        Fragment fragment = stages.get(0).getMapUnits().get(0).getFragments().get(0);
        Name name = fragment.getCompiled().getQualifiedName();

        ClassLoader loader = start();
        PortMapper mapper = new PortMapper(fragment);
        MockResult<Ex1> r1 = mapper.create("ex1");
        MockResult<Ex2> r2 = mapper.create("ex2");
View Full Code Here

Examples of com.asakusafw.compiler.flow.stage.StageModel.Fragment

        assert fragments != null;
        assert fgraph != null;
        Map<FlowBlock.Input, Graph<Fragment>> streams = new LinkedHashMap<FlowBlock.Input, Graph<Fragment>>();
        for (FlowBlock.Input blockInput : block.getBlockInputs()) {
            FlowElementInput input = blockInput.getElementPort();
            Fragment head = fragments.get(input.getOwner());
            Graph<Fragment> subgraph = createSubgraph(head, fgraph);
            streams.put(blockInput, subgraph);
        }
        List<MapUnit> results = Lists.create();
        for (Map.Entry<FlowBlock.Input, Graph<Fragment>> entry : streams.entrySet()) {
View Full Code Here

Examples of com.asakusafw.compiler.flow.stage.StageModel.Fragment

        }

        Map<FlowElement, Graph<Fragment>> streams = Maps.create();

        for (FlowElement element : inputGroups.keySet()) {
            Fragment head = fragments.get(element);
            Graph<Fragment> subgraph = createSubgraph(head, fgraph);
            streams.put(element, subgraph);
        }
        List<ReduceUnit> results = Lists.create();
        for (Map.Entry<FlowElement, Graph<Fragment>> entry : streams.entrySet()) {
View Full Code Here

Examples of com.asakusafw.compiler.flow.stage.StageModel.Fragment

        Graph<Fragment> result = Graphs.newInstance();
        for (Fragment fragment : fragments.values()) {
            result.addNode(fragment);
            for (FlowElementOutput output : fragment.getOutputPorts()) {
                for (FlowElementInput next : output.getOpposites()) {
                    Fragment successor = fragments.get(next.getOwner());
                    assert successor != null;
                    result.addEdge(fragment, successor);
                }
            }
        }
View Full Code Here

Examples of com.asakusafw.compiler.flow.stage.StageModel.Fragment

            Set<FlowElement> startElements) {
        assert context != null;
        assert startElements != null;
        Map<FlowElement, Fragment> results = Maps.create();
        for (FlowElement element : startElements) {
            Fragment fragment = getFragment(context, element, startElements);
            assert results.containsKey(element) == false;
            results.put(element, fragment);
        }
        return results;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.