JaRMoS  1.1
Java Reduced Model Simulations
 All Classes Namespaces Files Functions Variables Enumerator Groups Pages
RBActivity.java
Go to the documentation of this file.
1 package jarmos.app.activity.rb;
2 
3 import jarmos.Parameters;
6 import jarmos.app.R;
13 
14 import java.nio.FloatBuffer;
15 import java.nio.ShortBuffer;
16 import java.text.DecimalFormat;
17 import java.util.Arrays;
18 
19 import rb.Const;
20 import rb.RBContainer;
21 import rb.RBSystem;
22 import rb.SystemType;
24 import android.app.Activity;
25 import android.app.AlertDialog;
26 import android.app.Dialog;
27 import android.app.ProgressDialog;
28 import android.content.DialogInterface;
29 import android.content.DialogInterface.OnCancelListener;
30 import android.content.Intent;
31 import android.os.Bundle;
32 import android.os.Handler;
33 import android.os.Message;
34 import android.util.Log;
35 import android.view.View;
36 import android.widget.Button;
37 import android.widget.LinearLayout;
38 import android.widget.SeekBar;
39 import android.widget.TableLayout;
40 import android.widget.TextView;
41 
53 public class RBActivity extends Activity {
54 
55  // Dialog IDs
56  static final int DOWNLOAD_DIALOG_ID = 0;
57  static final int PROGRESS_DIALOG_ID = 1;
58  static final int DOWNLOAD_FAILED_DIALOG_ID = 2;
59  static final int RB_SOLVE_DIALOG_ID = 3;
60  static final int LOAD_DEMO_DIALOG_ID = 4;
61  static final int SWEEP_DIALOG_ID = 5;
62  static final int PARAM_DIALOG_ID = 6;
63 
64  // Activity ID
65  static final int SELECT_PROBLEM_TYPE = 0;
66 
67  // String for log printing
68  static final String DEBUG_TAG = "RBActivity";
69 
73  private ProgressDialog pd;
74 
78  // private TextView[] mParamLabels;
79  // private SeekBar[] mParamBars;
80  // private Button[] mParamButtons;
81 
85  // private int paramButtonIndex;
86  // private TextView paramInputField;
87 
95  public static int mOnlineNForGui = 1;
96 
101  // public static double[] mCurrentParamForGUI;
102 
106  // public static int mSweepIndex;
107 
111  protected String jarFileName = "AffineFunctions.jar";
115  private String dexFileName = "AffineFunctions.dex";
116 
120  public static RBContainer rb;
121 
125  public static ColorGenerator cg;
126 
127  private AModelManager mng;
128 
129  private ParamBars pb;
130 
131  public static FloatBuffer floatBuf;
132  public static ShortBuffer shortBuf;
133 
134  private Bundle bundle = null;
135 
137  @Override
138  public void onCreate(Bundle savedInstanceState) {
139  super.onCreate(savedInstanceState);
140  setContentView(R.layout.rb_main);
141 
142  // Create model manager instance to use
143  try {
144  mng = jarmos.app.Const.getModelManager(getApplicationContext(), getIntent());
145  } catch (ModelManagerException e) {
146  Log.e("RBActivity", "Creation of ModelManager failed", e);
147  finish();
148  return;
149  }
150 
151  rb = new RBContainer();
152  cg = new ColorGenerator();
157  floatBuf = VisualizationData.createFloatBuffer();
158  shortBuf = VisualizationData.createShortBuffer();
159 
160  // Add listener to the Solve button
161  Button solveButton = (Button) findViewById(R.id.solveButton);
162  solveButton.setOnClickListener(new View.OnClickListener() {
163  public void onClick(View view) {
164  pd = ProgressDialog.show(RBActivity.this, "", "Solving...");
165  new SolveThread().start();
166  }
167 
168  });
169 
170  // Attach a listener to onlineNSeekBar
171  SeekBar onlineNSeekBar = (SeekBar) findViewById(R.id.onlineNSeekbar);
172  onlineNSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
173  public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
174  mOnlineNForGui = (progress + 1);
175  TextView currentOnlineNView = (TextView) findViewById(R.id.currentOnlineN);
176  currentOnlineNView.setText("Online N = " + mOnlineNForGui);
177  }
178 
179  public void onStartTrackingTouch(SeekBar seekBar) {
180  }
181 
182  public void onStopTrackingTouch(SeekBar seekBar) {
183  }
184  });
185 
186  // Now, call the ListActivity to select problem
187  // Intent intent = new Intent(RBActivity.this,
188  // ProbSelectionActivity.class);
189  // RBActivity.this.startActivityForResult(intent, SELECT_PROBLEM_TYPE);
190 
191  AModelManager m = mng;
192  m.addMessageHandler(new ModelManagerProgressHandler() {
193 
197  @Override
198  public void handleMessage(Message msg) {
199  pd.setMessage(msg.getData().getString("file") + "...");
200  }
201 
202  });
203 
204  Log.d("DEBUG_TAG", "Loading model " + m.getModelDir());
205  String op = "Loading";
206  if (m instanceof CachingModelManager) {
207  op = "Caching";
208  } else if (m instanceof WebModelManager) {
209  op = "Downloading";
210  }
211  String title = op + " " + m.getModelDir() + "...";
212 
213  pd = ProgressDialog.show(RBActivity.this, title, "", true, true, new OnCancelListener() {
214  @Override
215  public void onCancel(DialogInterface dialog) {
217  setResult(0);
218  finish();
219  }
220  });
221  // Start the model loading
222  new ModelLoader(downloadHandler).start();
223  }
224 
228  public void onBackPressed() {
229  // need to tell parent activity to close all activities
230  getParent().onBackPressed();
231  }
232 
234  @Override
235  protected void onDestroy() {
236  super.onDestroy();
237  Log.d(DEBUG_TAG, "onDestroy() called");
238  // Clean up the files that were downloaded
240  }
241 
245  protected Dialog onCreateDialog(int id) {
246 
247  Dialog dialog;
248  AlertDialog.Builder builder;
249  RBSystem s = rb.mRbSystem;
250 
251  switch (id) {
252 
254 
255  String title = "Failed loading the model.";
256  Log.d(DEBUG_TAG, "Error loading model, modeldir: " + mng.getModelDir());
257  builder = new AlertDialog.Builder(this);
258  builder.setMessage(title).setCancelable(false)
259  .setNeutralButton("OK", new DialogInterface.OnClickListener() {
260  public void onClick(DialogInterface dialog, int id) {
261  RBActivity.this.finish();
262  }
263  });
264  dialog = builder.create();
265  }
266  break;
267 
268  case RB_SOLVE_DIALOG_ID:
269 
270  dialog = new Dialog(this);
271  dialog.setContentView(R.layout.rb_result_dialog);
272  dialog.setTitle("RB Solve Results");
273  dialog.setCancelable(false);
274 
275  Button okButton = (Button) dialog.findViewById(R.id.okButton);
276  okButton.setOnClickListener(new View.OnClickListener() {
277 
278  public void onClick(View view) {
279  dismissDialog(RB_SOLVE_DIALOG_ID);
280  removeDialog(RB_SOLVE_DIALOG_ID);
281  }
282 
283  });
284 
285  Button visButton = (Button) dialog.findViewById(R.id.steadyVisButton);
286  visButton.setOnClickListener(new View.OnClickListener() {
287 
288  public void onClick(View view) {
289  if (rb.mRbSystem.getNumDoFFields() > 0) {
290  Intent intent = new Intent(RBActivity.this, RBVisualization.class);
291  // The bundle was filled in onCreate / SolveThread!
292  intent.putExtras(bundle);
293  RBActivity.this.startActivity(intent);
294  }
295  }
296  });
297 
298  // Create the output string
299  String rb_solve_message = "Online N = " + mOnlineNForGui + "\n\u00B5 = [ "
300  + Arrays.toString(s.getParams().getCurrent()) + "]\n\n";
301 
302  DecimalFormat twoPlaces = new DecimalFormat("0.###E0");
303 
304  // Create a string that shows each output and error bound
305  if (s.isReal)
306  for (int i = 0; i < s.getNumOutputs(); i++) {
307 
308  double output_i = s.RB_outputs[i];
309  double output_bound_i = s.RB_output_error_bounds[i];
310 
311  rb_solve_message += "Output " + (i + 1) + ":\n" + "Value = " + twoPlaces.format(output_i) + "\n"
312  + "Error bound = " + twoPlaces.format(output_bound_i) + "\n\n";
313  }
314  else {
315  for (int i = 0; i < s.getNumOutputs(); i++) {
316 
317  double output_i_r = s.get_RB_output(i, true);
318  double output_bound_i_r = s.get_RB_output_error_bound(i, true);
319  double output_i_i = s.get_RB_output(i, false);
320  double output_bound_i_i = s.get_RB_output_error_bound(i, false);
321 
322  rb_solve_message += "Output " + (i + 1) + ":\n" + "Value = " + twoPlaces.format(output_i_r) + " + "
323  + twoPlaces.format(output_i_i) + "i\n" + "Error bound = "
324  + twoPlaces.format(output_bound_i_r) + " + " + twoPlaces.format(output_bound_i_i) + "i\n\n";
325  }
326  }
327 
328  TextView outputView = (TextView) dialog.findViewById(R.id.rb_solve_output);
329  outputView.setText(rb_solve_message);
330 
331  break;
332 
333  default:
334  dialog = null;
335  }
336  return dialog;
337  }
338 
339  protected void delete_downloaded_files() {
340  deleteFile(Const.parameters_filename);
341  deleteFile(jarFileName);
342  deleteFile(dexFileName);
343  }
344 
351  // private void displayParamValue(int index, double current_param) {
352  // String current_param_str;
353  // double abs = Math.abs(current_param);
354  // if ((abs < 0.1) && (current_param != 0.)) {
355  // DecimalFormat decimal_format = new DecimalFormat("0.###E0");
356  // current_param_str = decimal_format.format(current_param);
357  // } else if ((abs < 1) && (abs >= 0)) {
358  // DecimalFormat decimal_format = new DecimalFormat("@@@");
359  // current_param_str = decimal_format.format(current_param);
360  // } else {
361  // DecimalFormat decimal_format = new DecimalFormat("@@@@");
362  // current_param_str = decimal_format.format(current_param);
363  // }
364  //
365  // // Make sure we set the parameter to be the same as what the TextView
366  // // shows
367  // mCurrentParamForGUI[index] = Double.parseDouble(current_param_str);
368  //
369  // mParamLabels[index].setText(Html.fromHtml(s.getParams()
370  // .getLabel(index)));
371  // mParamButtons[index].setText(Html.fromHtml(current_param_str));
372  //
373  // // Set title
374  // TextView problemTitleView = (TextView) findViewById(R.id.problemTitle);
375  // problemTitleView.setText(rb.problemTitle);
376  // }
377 
381  private void initializeOnlineNBar() {
382  // Set max/min of online N seekbar
383  SeekBar onlineNSeekBar = (SeekBar) findViewById(R.id.onlineNSeekbar);
384  onlineNSeekBar.setMax(rb.mRbSystem.getNBF() - 1);
385 
386  // Change the progress state so that online N gets initialized
387  // to 1
388  // If we don't change away from 0, then onProgressChanged
389  // doesn't get called
390  onlineNSeekBar.setProgress(1);
391  onlineNSeekBar.setProgress(0);
392  }
393 
394  // /**
395  // * Initialize the list view depending on the number of parameters in the
396  // * system and on the parameter ranges.
397  // */
398  // private void initializeParamBars() {
399  //
400  // Parameters p = rb.mRbSystem.getParams();
401  // int np = p.getNumParams();
402  //
403  // // Create String array of parameters to store in the ListView
404  // try {
405  // TableLayout paramLayout = (TableLayout) findViewById(R.id.paramLayout);
406  //
407  // // Clear the paramLayout in case we're doing a new problem
408  // paramLayout.removeAllViews();
409  //
410  // mParamLabels = new TextView[np];
411  // mParamBars = new SeekBar[np];
412  // mParamButtons = new Button[np];
413  //
414  // for (int i = 0; i < np; i++) {
415  // TableRow row = new TableRow(this);
416  // row.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
417  // LayoutParams.FILL_PARENT));
418  //
419  // // First add the text label
420  // mParamLabels[i] = new TextView(this);
421  // mParamLabels[i].setTextSize(15); // Size is in scaled pixels
422  // mParamLabels[i].setLayoutParams(new TableRow.LayoutParams(
423  // TableRow.LayoutParams.WRAP_CONTENT,
424  // TableRow.LayoutParams.WRAP_CONTENT));
425  // mParamLabels[i].setPadding(0, 0, 4, 0);
426  // row.addView(mParamLabels[i]);
427  //
428  // // Next add the SeekBar
429  // mParamBars[i] = new IndexedSeekBar(this);
430  // ((IndexedSeekBar) mParamBars[i]).setIndex(i);
431  // mParamBars[i].setLayoutParams(new LayoutParams(
432  // LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
433  // mParamBars[i].setPadding(10, 10, 10, 0); // Set 10px padding on
434  // // left and right
435  // row.addView(mParamBars[i]);
436  //
437  // // Finally add the parameter value text
438  // mParamButtons[i] = new IndexedButton(this);
439  // ((IndexedButton) mParamButtons[i]).setIndex(i);
440  // row.addView(mParamButtons[i]);
441  //
442  // paramLayout.addView(row, new TableLayout.LayoutParams(
443  // LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
444  // }
445  //
446  // // Initialize mCurrentParamForGUI to min_parameter
447  // mCurrentParamForGUI = p.getCurrent();
448  // for (int i = 0; i < np; i++) {
449  // displayParamValue(i, mCurrentParamForGUI[i]);
450  //
451  // // Also set param bars to match current param
452  // int prog = (int) Math.round(100 * mCurrentParamForGUI[i]
453  // / (p.getMaxValue(i) - p.getMinValue(i)));
454  // mParamBars[i].setProgress(prog);
455  // }
456  // } catch (Exception e) {
457  // Log.e("RBActivity", "Failed init param bars", e);
458  // e.printStackTrace();
459  // }
460  //
461  // addParamBarListeners();
462  //
463  // addParamButtonListeners();
464  //
465  // }
466 
467  // /**
468  // * Add a new button to perform a parameter sweep
469  // */
470  // private void initializeParamSweep() {
471  //
472  // try {
473  //
474  // LinearLayout sweepLayout = (LinearLayout)
475  // findViewById(R.id.sweepButtonHolder);
476  //
477  // Button sweepButton = new Button(this);
478  // sweepButton.setText("\u00B5 Sweep");
479  // sweepButton.setTextSize(22);
480  // sweepButton.setOnClickListener(new View.OnClickListener() {
481  //
482  // public void onClick(View view) {
483  //
484  // // Create an alert dialog with radio buttons for
485  // // selecting the sweep parameter
486  // showDialog(SWEEP_DIALOG_ID);
487  // }
488  // });
489  //
490  // sweepLayout.addView(sweepButton, new LinearLayout.LayoutParams(
491  // LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
492  //
493  // } catch (Exception e) {
494  // e.printStackTrace();
495  // }
496  //
497  // }
498 
499  // // This helper function adds listeners to
500  // // the parameter value buttons
501  // private void addParamButtonListeners() {
502  // for (int i = 0; i < rb.mRbSystem.getParams().getNumParams(); i++) {
503  // mParamButtons[i].setOnClickListener(new View.OnClickListener() {
504  // public void onClick(View v) {
505  // paramButtonIndex = ((IndexedButton) v).getIndex();
506  // showDialog(PARAM_DIALOG_ID);
507  // }
508  // });
509  // }
510  // }
511 
512  // // This helper function adds the listeners
513  // // to the newly built parameter SeekBars
514  // private void addParamBarListeners() {
515  // final Parameters p = rb.mRbSystem.getParams();
516  // // Add a listener to each SeekBar
517  // for (int i = 0; i < p.getNumParams(); i++) {
518  // mParamBars[i]
519  // .setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
520  //
521  // public void onProgressChanged(SeekBar seekBar,
522  // int progress, boolean fromUser) {
523  //
524  // if (fromUser) {
525  // IndexedSeekBar isb = (IndexedSeekBar) seekBar;
526  // int index = isb.getIndex();
527  //
528  // if (rb.mRbSystem != null) {
529  // double param_range = p.getMaxValue(index)
530  // - p.getMinValue(index);
531  //
532  // double current_param = p.getMinValue(index)
533  // + param_range * progress
534  // / seekBar.getMax();
535  //
536  // displayParamValue(index, current_param);
537  // }
538  //
539  // }
540  // }
541  //
542  // public void onStartTrackingTouch(SeekBar seekBar) {
543  // }
544  //
545  // public void onStopTrackingTouch(SeekBar seekBar) {
546  // }
547  // });
548  // }
549  //
550  // }
551 
552  // final Handler sweepHandler = new Handler() {
553  // public void handleMessage(Message msg) {
554  // mSweepIndex = msg.what;
555  // Log.d(DEBUG_TAG, "Sweep index set to " + mSweepIndex);
556  // }
557  // };
558 
559  // Define the Handler that receives messages from the thread and updates the
560  // progress
561  // handler is a final member object of the RBActivity class
562  final Handler downloadHandler = new Handler() {
563  public void handleMessage(Message msg) {
564  // Now check if there was a problem or not
565  boolean downloadSuccessful = msg.getData().getBoolean("loadsuccess");
566  Log.d(DEBUG_TAG, "Model loading successful = " + downloadSuccessful + ", model dir: " + mng.getModelDir());
567 
568  if (!downloadSuccessful) {
569  pd.dismiss();
570  showDialog(DOWNLOAD_FAILED_DIALOG_ID);
572  } else {
573 
574  // Initialize the SeekBar for Online N
575  RBActivity.this.initializeOnlineNBar();
576 
577  // Initialize the ListView for the parameters
578  pb = new ParamBars(RBActivity.this, rb.mRbSystem.getParams());
579  pb.createBars((TableLayout) findViewById(R.id.paramLayout));
580 
581  // // Set link to problem info page
582  // TextView linkView = (TextView) findViewById(R.id.link_view);
583  // linkView.setText
584  // ("http://augustine.mit.edu/methodology.htm"); // re-write
585  // this to be
586  // // problem-specific
587 
590  pb.createSweepButton((LinearLayout) findViewById(R.id.sweepButtonHolder));
591  }
592 
593  // Set title
594  TextView problemTitleView = (TextView) findViewById(R.id.problemTitle);
595  problemTitleView.setText(rb.problemTitle);
596 
597  pd.dismiss();
598  }
599  }
600  };
601 
603  private class ModelLoader extends Thread {
604 
605  // The model's directory
606  private final AModelManager m = mng;
607 
608  // Handler to interact with this thread
609  private Handler mHandler;
610 
611  // Boolean to indicate if we download from server
612  // or load from the assets directory
613  // boolean isDownload;
614 
615  // The index of the demo we have chosen
616  // int mDemoIndex;
617 
621  ModelLoader(Handler h) {
622  mHandler = h;
623  }
624 
628  public void run() {
629 
630  boolean success = true;
631 
632  // Call the main model loading method
633  success &= rb.loadModel(m);
634 
635  // Clean up if the model fails to load
636  if (!success && m instanceof CachingModelManager) {
637  ((CachingModelManager) m).deleteCachedFiles();
638  }
639 
640  Message msg = mHandler.obtainMessage();
641  Bundle b = new Bundle();
642  b.putBoolean("loadsuccess", success);
643  msg.setData(b);
644  mHandler.sendMessage(msg);
645  }
646  }
647 
648  private class SolveThread extends Thread {
649  public void run() {
650  RBSystem s = rb.mRbSystem;
651  Parameters p = s.getParams();
652 
653  // Create the bundle and initialize it
654  bundle = new Bundle();
655 
656  switch (rb.getSystemType()) {
657 
658  case LINEAR_STEADY:
659  case LINEAR_COMPLEX_STEADY:
660 
661  if (pb.getSweepIndex() == -1) {
662 
663  s.computeRBSolution(mOnlineNForGui);
664  bundle.putBoolean("isSweep", false);
665 
666  handler.sendEmptyMessage(0);
667  } else { // We need to perform a sweep
668 
672  int pts = s.performSweep(pb.getSweepIndex(), mOnlineNForGui);
673  bundle.putBoolean("isSweep", true);
674 
675  bundle.putInt("sweepIndex", pb.getSweepIndex());
676  bundle.putString("title", "Online N = " + mOnlineNForGui);
677  bundle.putDouble("dt", s.getSweepIncrement());
678  bundle.putDouble("xMin", p.getMinValue(pb.getSweepIndex()));
679  bundle.putDouble("xMax", p.getMaxValue(pb.getSweepIndex()));
680  bundle.putString("xLabel", Integer.toString(pb.getSweepIndex() + 1));
681  bundle.putInt("n_time_steps", pts);
682  bundle.putInt("n_outputs", s.getNumOutputs());
683  for (int i = 0; i < s.getNumOutputs(); i++) {
684  bundle.putDoubleArray("output_data_" + i, s.getSweepOutputs()[i]);
685  bundle.putDoubleArray("output_bound_" + i, s.getSweepOutputBounds()[i]);
686  }
687  // Add this bundle to the intent and plot
688  Intent intent = new Intent(RBActivity.this, OutputPlotterActivity.class);
689  intent.putExtras(bundle);
690  RBActivity.this.startActivity(intent);
691  }
692 
693  break;
694  case LINEAR_UNSTEADY:
695  case QN_UNSTEADY:
696 
697  // Perform the solve
698  s.computeRBSolution(mOnlineNForGui);
699 
700  bundle.putBoolean("isReal", s.isReal);
704  bundle.putBoolean("isSweep", false);
705  bundle.putString("title",
706  "Online N = " + mOnlineNForGui + ", parameter = " + Arrays.toString(p.getCurrent()));
707  bundle.putDouble("dt", ((TransientRBSystem) s).getdt());
708  bundle.putDouble("xMin", 0);
709  bundle.putDouble("xMax", ((TransientRBSystem) s).getdt() * s.getTotalTimesteps());
710  bundle.putString("xLabel", "time");
711  bundle.putInt("n_time_steps", ((TransientRBSystem) s).n_plotting_steps);
712  bundle.putInt("n_outputs", s.getNumOutputs());
713 
714  for (int i = 0; i < s.getNumOutputs(); i++) {
715  bundle.putDoubleArray("output_data_" + i, s.RB_outputs_all_k[i]);
716  bundle.putDoubleArray("output_bound_" + i, s.RB_output_error_bounds_all_k[i]);
717  }
718 
719  // Add this bundle to the intent and plot
720  Intent intent = new Intent(RBActivity.this, OutputPlotterActivity.class);
721  intent.putExtras(bundle);
722  RBActivity.this.startActivity(intent);
723 
724  break;
725  default:
726  throw new RuntimeException("Invalid/unknown RB system type for solve: " + rb.getSystemType());
727  }
728 
729  // Dismiss progress dialog
730  handler.sendEmptyMessage(-1);
731  }
732 
733  private final Handler handler = new Handler() {
734  public void handleMessage(Message msg) {
735  pd.dismiss();
736  if (msg.what == 0)
737  RBActivity.this.showDialog(RB_SOLVE_DIALOG_ID);
738  }
739  };
740 
741  }
742 
743 }
static final int RB_SOLVE_DIALOG_ID
Definition: RBActivity.java:59
SystemType getSystemType()
Linear, complex valued time-independent/steady state rb system.
Definition: SystemType.java:37
static int mOnlineNForGui
Array of TextViews and SeekBars for constructing the parameter selection.
Definition: RBActivity.java:95
int getNumDoFFields()
Returns the number of degree-of-freedom fields generated/computed by the model.
Definition: ModelBase.java:78
A helper class for a collection of UI elements regarding model parameter display. ...
Definition: ParamBars.java:37
This class provides the Online stage for the reduced basis method for elliptic steady state problems...
Definition: RBSystem.java:54
RBSystem mRbSystem
The RBSystem object.
static final int DOWNLOAD_DIALOG_ID
Definition: RBActivity.java:56
String jarFileName
The current parameter constructed by the GUI.
Dialog onCreateDialog(int id)
This function takes care of constructing the dialogs that pop up.
This class provides the Online reduced basis functionality for linear parabolic problems.
This is the main Activity class for the app.
Definition: RBActivity.java:53
Main RB visualization activity.
static RBContainer rb
The RB Container with all the system and model data (from JRB)
Parameters getParams()
Returns the system&#39;s parameters object.
Definition: RBSystem.java:621
Base class for RB models and systems.
void onCreate(Bundle savedInstanceState)
Called when the activity is first created.
static final String DEBUG_TAG
Definition: RBActivity.java:68
static final int DOWNLOAD_FAILED_DIALOG_ID
Definition: RBActivity.java:58
This class serves as base class for accessing various types of models at different locations...
A class for model parameters.
Definition: Parameters.java:17
static ColorGenerator cg
The color generator used to color the field values.
void onDestroy()
Called when the activity is destroyed.
LINEAR_STEADY
Linear, time-invariant/steady state rb system.
Definition: SystemType.java:22
A container class for all model visual data.
A model manager reading models from a remote web location.
static final int PROGRESS_DIALOG_ID
Definition: RBActivity.java:57
This Exception gets thrown when an error occurs regarding the functionality of the ModelManager...
boolean isReal
Definition: RBSystem.java:119
static final String parameters_filename
Inherited from the rbAppMIT models to read the model parameters.
Definition: Const.java:13
The color generator is used to produce RGBA (RGB+Alpha) values from a given array of floats...
static final int SELECT_PROBLEM_TYPE
Definition: RBActivity.java:65
final Handler downloadHandler
Initialize the list view depending on the number of parameters in the system and on the parameter ran...
A wrapper class that takes any AModelManager as source and a FileModelManager as target.
Class with constants used throughout JRB.
Definition: Const.java:9
static final int LOAD_DEMO_DIALOG_ID
Definition: RBActivity.java:60
A progress notification handler implementation for android platforms.
Enum for known RB system types in JRB.
Definition: SystemType.java:13