diff --git a/src/functions/node.ts b/src/functions/node.ts index fbf789c..bc8fd28 100644 --- a/src/functions/node.ts +++ b/src/functions/node.ts @@ -4,7 +4,6 @@ import { State } from '../utils/state'; import { calcHValue } from './heuristic'; import { applyOperation } from './operations'; import HeuristicValue from '../classes/HeuristicValue'; -import { readState } from './state'; function generateNodeList(node: NodeInfo, goalState: State): NodeInfo[]{ let childrenNodes: NodeInfo[] = []; @@ -49,15 +48,4 @@ function generateNode(state: State, op: operations, goalState: State, gValue: nu return new NodeInfo(heuristicValue, op, state, previousNode); } - -function readNode(node: NodeInfo): NodeInfo{ - readState(node.state); - if(node.previousNode){ - return readNode(node.previousNode); - } - else{ - return node; - } -} - -export { generateNodeList, generateNode, readNode } \ No newline at end of file +export { generateNodeList, generateNode } \ No newline at end of file diff --git a/src/functions/state.ts b/src/functions/state.ts index 73efd6d..45f0865 100644 --- a/src/functions/state.ts +++ b/src/functions/state.ts @@ -68,12 +68,4 @@ function convertArrayInState(stateList: StateAsList): State{ return state; } -function readState(state: State){ - console.log('---------'); - for(let l of state){ - console.log(l); - } - console.log('---------'); -} - -export { areEqual, includes, readState, isSolvable, convertArrayInState, convertStateInArray } \ No newline at end of file +export { areEqual, includes, isSolvable, convertArrayInState, convertStateInArray } \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 69824a4..c70a6c0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ import { operations } from './utils/operations'; import { State } from "./utils/state"; import { NodeInfo } from "./classes/Node"; -import { generateNodeList, generateNode, readNode } from './functions/node'; +import { generateNodeList, generateNode } from './functions/node'; import { areEqual, includes, isSolvable } from './functions/state'; import { Frontier } from './utils/frontier';