From 3aec36d0c0f457ebecedb2689184926e52e806c6 Mon Sep 17 00:00:00 2001 From: Antonio De Lucreziis Date: Wed, 12 Feb 2025 01:34:54 +0100 Subject: [PATCH] translated everything to english --- README.md | 31 +++++++++++-------------------- index.html | 8 ++++---- src/Primal.tsx | 4 ++-- src/lib-v2/ro/primal-simplex.ts | 14 +++++++------- src/main.tsx | 32 +++++++++++++++----------------- src/parser-problem.tsx | 18 +++++++++--------- 6 files changed, 48 insertions(+), 59 deletions(-) diff --git a/README.md b/README.md index d8470ac..5ffce5a 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,18 @@ -# Ricerca Operativa / PL / Algoritmo del Simplesso +# Operations Research / Linear Programming / Simplex Algorithm -Questo sito è un progetto per il corso di Ricerca Operativa dell'Università di Pisa per visualizzare -automaticamente tutti i passaggi dell'algoritmo del simplesso primale. +This website is a project for the course of Operations Research of the +University of Pisa to automatically visualize automatically all steps of the +primal simplex algorithm. -## Caratteristiche principali +## Features -- Visualizza automaticamente tutti i passaggi dell'algoritmo del simplesso primale +- Automatically visualize all steps of the primal simplex algorithm -- Gestisce problemi d ricerca operativa in formato matriciale +- Save and load problems -- Permette il salvataggio e il caricamento di problemi +- Preact as frontend framework -- Utilizza Preact per una interfaccia interattiva - -## Funzionamento - -1. Inserisci i dati del problema nel campo di testo nel formato specificato - -2. Il sistema analizza l'input mostra il risultato dell'algoritmo con tutti i passaggi algebrici - dell'algoritmo con una visualizzazione geometrica dello stato corrente - -3. Puoi salvare i problemi inseriti e caricarli in seguito - -## Svilluppo +## Development ### Setup @@ -42,7 +32,8 @@ bun dev ### Build -Use this command to build the project and serve the files from the `dist/` directory. +Use this command to build the project and serve the files from the `dist/` +directory. ```bash bun run build diff --git a/index.html b/index.html index 1180e9d..99aabb4 100644 --- a/index.html +++ b/index.html @@ -10,14 +10,14 @@ - - - + + + - Algoritmo del Simplesso | PL | Ricerca Operativa + Simplex Algorithm | LP | Operations Research diff --git a/src/Primal.tsx b/src/Primal.tsx index 7fa5bdf..be49bc9 100644 --- a/src/Primal.tsx +++ b/src/Primal.tsx @@ -53,7 +53,7 @@ const PrimalStep = ({

- Iterazione {iter + 1} dell'algoritmo + Iteration {iter + 1} of the algorithm

@@ -105,7 +105,7 @@ export const Primal = ({ input }: { input: ProblemInput }) => { {problemOutput ? ( <>
-

Svolgimento

+

Visualization

{problemOutput.steps.map((step, iter) => ( i !== h), k].toSorted() } else { - comments.push({ type: 'text', content: 'La soluzione è *illimitata*' }) + comments.push({ type: 'text', content: 'The solution is *unbounded*' }) status = { result: 'unbounded', xi } } } else { - comments.push({ type: 'text', content: 'La soluzione è *ottima*' }) + comments.push({ type: 'text', content: 'The solution is *optimal*' }) status = { result: 'optimal', x } } @@ -258,7 +258,7 @@ export function computePrimalSimplexSteps(input: ProblemInput): ProblemOutput { comments.push({ type: 'text', - content: 'In questo caso bisogna usare il metodo del *simplesso duale*.', + content: 'In this case you need to use the *dual simplex* algorithm.', }) status = { result: 'wrong-starting-basis' } diff --git a/src/main.tsx b/src/main.tsx index 688f844..00878e9 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -9,6 +9,11 @@ import { Primal } from './Primal' import exampleProblems from './example-problems.json' +type Problem = { + name: string + source: string +} + const INITIAL_PROBLEM_INPUT = ` c' = 500 200; @@ -42,15 +47,8 @@ const useLocalStorage = (key: string, initialValue: T) => { } const App = () => { - const [currentProblemName, setCurrentProblemName] = useLocalStorage( - 'ricerca-operativa.currentProblemName', - 'Pintel' - ) - - const [savedProblems, setSavedProblems] = useLocalStorage<{ name: string; source: string }[]>( - 'ricerca-operativa.savedProblems', - exampleProblems - ) + const [currentProblemName, setCurrentProblemName] = useLocalStorage('current-problem-name', 'Pintel') + const [savedProblems, setSavedProblems] = useLocalStorage('saved-problems', exampleProblems) const [problemInput, setProblemInput] = useState( savedProblems.find(p => p.name === currentProblemName)?.source ?? INITIAL_PROBLEM_INPUT @@ -61,20 +59,20 @@ const App = () => { return ( <>

- Ricerca Operativa / PL / Algoritmo del Simplesso + Operations Research / LP / Simplex Algorithm {' '} by @aziis98

- Questo sito è un progetto per il{' '} - corso di Ricerca Operativa{' '} - dell'Università di Pisa per visualizzare automaticamente tutti i passaggi dell' - algoritmo del simplesso primale. + This is a project for the{' '} + Operative Research course at + the University of Pisa to automatically visualize all the steps of the{' '} + primal simplex algorithm.

-

Visualizzazione

-

I dati del problema vanno inseriti nel seguente campo di testo nel formato:

+

Visualization

+

The problem data must be entered in the following text field in the format: