NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
November 20, 2017, 07:09:04 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
First time is the lat time. ...Wisdom
Google Bookmarks Yahoo My Web MSN Live Netscape Del.icio.us FURL Stumble Upon Delirious Ask FaceBook

Pages: [1]   Go Down
  Print  
Author Topic: Some questions about JVS  (Read 7786 times)
0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
snikalay
Newbie
*
Offline Offline

Posts: 2

«
Embed this message
on: April 23, 2009, 09:07:01 pm » posted from:Ghent,Oost-Vlaanderen,Belgium

Hi,

I am a student and I want to use the JVS for a project. I have some knowledge about Java and programming in general. Can you help me with the following questions:

Is it possible to create classes of objects that are in a simulations for example:
- class robot: that has the possibility to move and to accelerate and break with the restriction that has a collision avoidance function that can not allow to have a collision between 2 or more such objects. The path is known for each robot and is not random
- class box: a robot carry a box from A to B. The box doesn't have any dynamics only the coordinates.
Is it possible to create a more flexible environment for a simulation like giving for the user to chose how many objects and how to arrange the objects on this 2D board?
Do you have a model or example of such a problem from where I could start?

Thank you in advance,
Niko.



Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #1 on: April 23, 2009, 11:00:19 pm » posted from:Taipei,T\'ai-pei,Taiwan

I do not know the meaning of "JVS" ?
It is possible to create class to do what you want.
The question is you need to structure your design into model and rules.
You might want to learn to program it with EJS.
You are also welcomed to check out all the simulations at this web site.
Logged
snikalay
Newbie
*
Offline Offline

Posts: 2

«
Embed this message
Reply #2 on: April 24, 2009, 06:54:30 pm » posted from:Ghent,Oost-Vlaanderen,Belgium

Hi again,

"I do not know the meaning of "JVS" ? "

My mistake I was in a hurry, I wanted to write EJS -Easy Java Simulations.

"The question is you need to structure your design into model and rules.
You might want to learn to program it with EJS."

What I wanted to say with that class is that I want to create a mathematical model but with the features from object oriented programming. As I said I want to be able to define many objects Robot that have the same features (same equations for movement, same methods) but each to behave as stand alone entity and to perform a stand alone task. To go further let's take for example that simulation made by you called "traffic control simulation". For example if I want to introduce in that model the a random turns for each car that is coming to a intersection and I want to create the class car that holds the information and methods for each car is it possible to do that in EJS? Can you give me an example of yours where you used this kind of approach - classes?
I want to use this kind of structuring for future development.

Can you help me to find a good explanations(documents, links or may be you already explained somewhere) about how EJS is working?

Regards,
Niko.

Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #3 on: April 24, 2009, 08:39:21 pm » posted from:Taipei,T\'ai-pei,Taiwan

EJS is a java code generator. It is not designed for professional programmer. It is designed for user who know about the physics model but lack of programming skill and detail java programming. But the user need to understand basic program structure and logic. It has build in GUI interface so that user can use it directly. User just need to assign properties to variables/values defined in EJS. EJS also has build it numerical solver to do numerical integration for you.
Please check out Information and Download for related information and documents. There are pdf files and html pages about EJS, please read it first.
You would not be able to define class in EJS. But you can write your own java class and import into EJS.
I used to write java code line by line (befroe 2001). But I switched to EJS when I learn about EJS.
It save me a lot of time. Most of the simulations can be created within several hours because I do not need to write code to create GUI elements.
I did not define java class in "traffic control simulation". I add all the necessary code in EJS.
You can add code in "Fixed relaton pages" if you just want to add random turn when car arrive at an interaction.
For example:
Code:
if x[],y[] and vx[] and vy[] are position and velocity vector for each car.
for(int i=0;i<n;i++){
 if(car_at_interaction(i,x,y)){// define function car_at_interaction to check ith car arrive at interaction
  if(vx[i]==0){// car moving in y direction
  if(Math.random()>0.5){
  vy[i]=vx[i];// car make a left turn
  }else{
  vy[i]=-vx[i];// car make a right turn
  }
  vx[i]=0;
  }else {// car moving in x direction
  if(Math.random()>0.5){
  vx[i]=vy[i];// car make a left turn
  }else{
  vx[i]=-vy[i];// car make a right turn
  }
  vy[i]=0;
  }
 }
}
Logged
ChaWhoZer
Newbie
*
Offline Offline

Posts: 1

«
Embed this message
Reply #4 on: July 04, 2009, 01:39:01 pm » posted from:Manila,Manila,Philippines

I do not apperceive the acceptation of "JVS" ?

It is accessible to actualize chic to do what you want.

The catechism is you charge to anatomy your architecture into archetypal and rules.

You ability wish to apprentice to affairs it with EJS.

You are aswell accustomed to analysis out all the simulations at this web site.


-*-

Logged
aufche
watchlist
Newbie
*
Offline Offline

Posts: 8



«
Embed this message
Reply #5 on: November 05, 2009, 08:30:58 am » posted from:Jakarta,Jakarta Raya,Indonesia

very confused for me....i learn PHP...its help to understand this topics?-*-
Logged
Pages: [1]   Go Up
  Print  
First time is the lat time. ...Wisdom
 
Jump to:  


Related Topics
Subject Started by Replies Views Last post
questions the singularity
Physics Questions
arthuryu123 2 18011 Last post December 20, 2013, 04:04:32 pm
by AnnieWilliams
Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.056 seconds with 22 queries.since 2011/06/15