BFS utility

Overview

How to use

Example (Usage for https://www.codingame.com/contests/spring-challenge-2021 usage)

gameContext.getAllTree().stream().forEach(tree ->
        {
            if (tree.getSize() > 0) {
                BFS.compute(tree.getCell(),
                        (Cell cell, List<Cell> path) -> cell.setDistToTree(path)
                        ,Cell::getNeighbourgs
                        ,true
                        ,tree.getSize() - 1);
            }
        });
class Cell {

    public void setDistToTree(List path) {
        Cell accessibleCell = path.get(path.size() - 1);
        Tree tree = path.get(0).getTree();
        if (accessibleCell.getTree() == null && accessibleCell.getRichness() > 0 && !tree.isDormant()) {
            if (tree.isMine()) {
                accessibleCell.setCanSeed(true);
                accessibleCell.addSourceTree(tree);
            }
            else {
                accessibleCell.setCanSeedOpp(true);
                accessibleCell.addSourceTreeOpp(tree);
            }
        }
        distByTree.put(tree, path.size());
    }
}
You might also like...

A 1.16.5 utility mod oriented towards anarchy servers

FrostBurn A 1.16.5 utility mod oriented towards anarchy servers Progress Command System Module System Friends Settings ClickGUI Render Modules Chams F

Dec 24, 2022

Some utility classes around java records

record-util Some utility classes around java records On the menu MapTrait Transform any record to a java.util.Map just by implementing the interface M

Apr 6, 2022

A minecraft utility mod for 1.12.2.

A minecraft utility mod for 1.12.2.

Teddyware Utility Mod Teddyware is a utility mod for minecraft anarchy servers for 1.12.2. It is like optifine, and should only be used on servers tha

Dec 2, 2022

Minecraft 1.16.5 Utility Mod for Anarchy and Crystal PvP

Minecraft 1.16.5 Utility Mod for Anarchy and Crystal PvP

Fabric 1.16.5 port for GameSense. A more interesting readme will be coming soon, but check out the main repo at https://github.com/IUDevman/gamesense-

Dec 2, 2022

A base for Forge 1.12.2 utility mods to use.

ClientBase Why? I made this for learning and for use in my private client ZWare.cc. TO-DO Add ClickGUI Add HUD and HUDEditor Add Javadocs How to use?

Dec 2, 2022

based utility mod

Urmomia Client urmomia strong, oa based clients strong Credits Devs Honsda - based creator Codex - based Kambing - based nekohax dev and antec player

Dec 31, 2022

🕵️ Lightweight utility to intercept WebDriver and WebElement method calls.

🕵️  Lightweight utility to intercept WebDriver and WebElement method calls.

Lightweight utility to intercept webdriver and webelement method calls. Supports both Selenium and Appium drivers About | To Get Started | Installatio

Jul 1, 2022

Utility to automatically manage all web element waits and enables to write wait-free selenium tests.

selenium-auto-wait selenium-auto-wait automatically manages all weblement waits and makes you to write wait free selenium tests. Features Waits till e

Nov 1, 2022

CookieClient is a utility client for anarchy servers

CookieClient CookieClient is a utility client for anarchy servers. Its a forge mod so you need forge to run it. Currently supported versions: 1.12.2 D

Dec 4, 2022

Excel utility for Java to read and write data in declarative way.

Excel utility for Java to read and write data in declarative way.

Data Excel Exporter A Java wrapper using Apache POI to read and write Excel file in declarative fashion. Installation ExcelUtil is using Apache POI ve

Oct 16, 2022

1.17.1 minecraft utility mod

Blitz 1.17.1 minecraft utility mod Designed to be used as a mod with the fabric mod loader Project Status This project is basically on hold until 2b2t

Dec 23, 2021

This client is still in development - Xena is a 1.12.2 Minecraft Utility Mod designed for Anarchy servers such as 2b2t/9b9t/5b5t etc, Devs are not responsible for improper usage.

Xena-client This client is still in development - Xena is a 1.12.2 Minecraft Utility Mod designed for Anarchy servers such as 2b2t/9b9t/5b5t etc, Devs

Oct 18, 2021

Simple, declarative mail utility for sending mails with default smtp server or with custom channels.

Introduction email-util is simple, declarative utility library. Key features are: declarative email building; text or html rendering; annotation suppo

Oct 12, 2021

An utility to usage efficience ByteArray in Kotlin and Java.

An utility to usage efficience ByteArray in Kotlin and Java.

Sep 29, 2021

The utility is designed to implement version control of APEX application pages.

The utility is designed to implement version control of APEX application pages.

Oracle APEX version control tool The utility is designed to implement version control of APEX application pages. How it works The developer exports th

Aug 25, 2022

COMPortNotifier - Smol utility to send you a notification every time you connect, or disconnect a COM port.

COMPortNotifier - Smol utility to send you a notification every time you connect, or disconnect a COM port.

COMPortNotifier A smol utility that sends you a notification every time a COM port is connected, or disconnected on your computer. Useful for electric

Sep 7, 2022

A 1.16.5 Utility Mod in Fabric

A 1.16.5 Utility Mod in Fabric

FagHax A 1.16.5 Fabric client. Authors KRYMZ0N Scriptyure (UwU) Development Status Currently in active development. Currently commiting every day. Bas

Apr 3, 2022

High Performance data structures and utility methods for Java

High Performance data structures and utility methods for Java

Agrona Agrona provides a library of data structures and utility methods that are a common need when building high-performance applications in Java. Ma

Jan 7, 2023

A simple utility that allows you to query which items can be placed in a specific slot by holding down Left-Alt

A simple utility that allows you to query which items can be placed in a specific slot by holding down Left-Alt

What's That Slot This mod is a simple utility that allows you to query which items can be placed in a specific slot by holding down Left-Alt. You can

Dec 25, 2022
Releases(2021.07.15)
Owner
Guillaume Rousseau
Guillaume Rousseau
jetbrick utility classes

jetbrick-commons This is an utility classes project for jetbrick framework. Documentation http://subchen.github.io/ Dependencies <dependency> <gro

Guoqiang Chen 20 Nov 15, 2022
Utility for developers and QAs what helps minimize time wasting on writing the same data for testing over and over again. Made by Stfalcon

Stfalcon Fixturer A Utility for developers and QAs which helps minimize time wasting on writing the same data for testing over and over again. You can

Stfalcon LLC 31 Nov 29, 2021
Simple, declarative mail utility for sending mails with default smtp server or with custom channels.

Introduction email-util is simple, declarative utility library. Key features are: declarative email building; text or html rendering; annotation suppo

Nijat Asgarzada 3 Oct 12, 2021
An utility to usage efficience ByteArray in Kotlin and Java.

An utility to usage efficience ByteArray in Kotlin and Java.

Cuong V. Nguyen 5 Sep 29, 2021
A utility for guessing the CCSID of files (based on file contents)

CcsidGuesser A utility for guessing the CCSID of files (based on file contents). It can also fix CCSID tags and/or convert files to UTF-8! Usage Usage

Jesse Gorzinski 4 Feb 21, 2022
"Pathfinder" - a small demo app made in Java, using Swing which shows an example implementation of a pathfinding algorithm based on BFS

"Pathfinder" is a small demo app made in Java, using Swing which shows an example implementation of a pathfinding algorithm based on BFS.

Dan Sirbu 2 Mar 9, 2022
High Performance data structures and utility methods for Java

Agrona Agrona provides a library of data structures and utility methods that are a common need when building high-performance applications in Java. Ma

Real Logic 2.4k Dec 31, 2022
jetbrick utility classes

jetbrick-commons This is an utility classes project for jetbrick framework. Documentation http://subchen.github.io/ Dependencies <dependency> <gro

Guoqiang Chen 20 Nov 15, 2022
Utility for developers and QAs what helps minimize time wasting on writing the same data for testing over and over again. Made by Stfalcon

Stfalcon Fixturer A Utility for developers and QAs which helps minimize time wasting on writing the same data for testing over and over again. You can

Stfalcon LLC 31 Nov 29, 2021
High Performance data structures and utility methods for Java

Agrona Agrona provides a library of data structures and utility methods that are a common need when building high-performance applications in Java. Ma

Real Logic 2.5k Jan 5, 2023