|
import gradio |
|
import kaboom |
|
from kaboom.carMakers import runCarDesignProblem |
|
|
|
def run_kaboom(reps, steps, comms): |
|
|
|
|
|
|
|
parameters = kaboom.params.Params() |
|
parameters.reps = reps |
|
parameters.pComm = comms |
|
parameters.steps = steps |
|
|
|
|
|
team = runCarDesignProblem(parameters) |
|
|
|
|
|
|
|
return team.getBestScore()*-1 |
|
|
|
gradio.Interface( |
|
fn = run_kaboom, |
|
inputs = [ |
|
gradio.Number(label="Number of teams", value=2), |
|
gradio.Number(label="Steps", value=300), |
|
gradio.Number(label="Probability of Communication", value=0.2), |
|
], outputs = [gradio.Number(label="Performance")] |
|
).launch(debug=True) |