MCPcopy Create free account
hub / github.com/StevenLyt/mapf-visualizer / startNewTask

Method startNewTask

src/MAPFVisualizer.jsx:451–490  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

449 }
450
451 startNewTask() {
452 this.setState(
453 {
454 numRow: DEFAULTROW,
455 numCol: DEFAULTCOL,
456 tempRow: DEFAULTROW,
457 tempCol: DEFAULTCOL,
458 map: this.createEmptyMap(DEFAULTROW, DEFAULTCOL),
459 agents: [],
460 numAgents: 0,
461 addedSRow: null,
462 addedSCol: null,
463 addedGRow: null,
464 addedGCol: null,
465 snackbarOpen: false,
466 isError: false,
467 isMousePressed: false,
468 isPlanning: false,
469 isPlanned: false,
470 isAnimationFinished: false,
471 planningTime: -1,
472 planningStatus: "",
473 paths: [],
474 options: structuredClone(this.props.populate.options),
475 algorithmSummary: "",
476
477 startToAdd: false,
478 goalToAdd: false,
479 speed: 0.6,
480 },
481 () => {
482 for (let i = 0; i < DEFAULTROW; i++) {
483 for (let j = 0; j < DEFAULTCOL; j++) {
484 document.getElementById(`grid-${i}-${j}`).style.backgroundColor = "";
485 document.getElementById(`grid-${i}-${j}`).style.border = "";
486 }
487 }
488 }
489 );
490 }
491
492 populateDescription() {
493 return (

Callers 1

renderMethod · 0.95

Calls 1

createEmptyMapMethod · 0.95

Tested by

no test coverage detected