Move `weightsToEdgeEvaluator` to `analysis` (#969)
The logic for converting weights into an edge evaluator should not be coupled to the frontend application. Progress towards #967. Test plan: Very straightforward rename; `yarn test` suffices.
This commit is contained in:
parent
48a66c8118
commit
b077bd8179
|
@ -1,9 +1,9 @@
|
|||
// @flow
|
||||
|
||||
import type {Edge} from "../../../core/graph";
|
||||
import type {WeightedTypes} from "../../../analysis/weights";
|
||||
import type {EdgeEvaluator} from "../../../analysis/pagerank";
|
||||
import {NodeTrie, EdgeTrie} from "../../../core/trie";
|
||||
import type {Edge} from "../core/graph";
|
||||
import type {WeightedTypes} from "./weights";
|
||||
import type {EdgeEvaluator} from "./pagerank";
|
||||
import {NodeTrie, EdgeTrie} from "../core/trie";
|
||||
|
||||
export function weightsToEdgeEvaluator(weights: WeightedTypes): EdgeEvaluator {
|
||||
const nodeTrie = new NodeTrie();
|
|
@ -1,19 +1,16 @@
|
|||
// @flow
|
||||
|
||||
import * as NullUtil from "../../../util/null";
|
||||
import {
|
||||
fallbackNodeType,
|
||||
fallbackEdgeType,
|
||||
} from "../../../analysis/fallbackDeclaration";
|
||||
import * as NullUtil from "../util/null";
|
||||
import {fallbackNodeType, fallbackEdgeType} from "./fallbackDeclaration";
|
||||
import {
|
||||
inserterNodeType,
|
||||
machineNodeType,
|
||||
assemblesEdgeType,
|
||||
} from "../../../plugins/demo/declaration";
|
||||
import {edges as factorioEdges} from "../../../plugins/demo/graph";
|
||||
} from "../plugins/demo/declaration";
|
||||
import {edges as factorioEdges} from "../plugins/demo/graph";
|
||||
import {weightsToEdgeEvaluator} from "./weightsToEdgeEvaluator";
|
||||
|
||||
describe("app/credExplorer/weights/weightsToEdgeEvaluator", () => {
|
||||
describe("analysis/weightsToEdgeEvaluator", () => {
|
||||
describe("weightsToEdgeEvaluator", () => {
|
||||
type WeightArgs = {|
|
||||
+assemblesForward?: number,
|
|
@ -14,7 +14,7 @@ import {
|
|||
|
||||
import {StaticAdapterSet, DynamicAdapterSet} from "../adapters/adapterSet";
|
||||
import type {WeightedTypes} from "../../analysis/weights";
|
||||
import {weightsToEdgeEvaluator} from "./weights/weightsToEdgeEvaluator";
|
||||
import {weightsToEdgeEvaluator} from "../../analysis/weightsToEdgeEvaluator";
|
||||
|
||||
/*
|
||||
This models the UI states of the credExplorer/App as a state machine.
|
||||
|
|
Loading…
Reference in New Issue