Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
    Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

I want to add some touch screen abilities to my program, how to do that?

 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Report post to moderator
How to implement the MonteCarlo Algorithm to be able to make a touch screen program? What formula that is used in MonteCarlo Algorithm?
 
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
  • Report post to moderator
What does a MonteCarlo Algorithm have to do with having touch screen abilities?

BTW touch screen abilities is nothing to do with Java. You need a screen that has touch screen capability and normally they come with drivers that simulate a mouse. Java doesn't know/care whether, for instance, a mouse button 1 press notification comes from you clicking the mouse, tapping the mouse pad or tapping the screen, your program just gets sent the mouse pressed event.
 
lowercase baba
Posts: 12800
51
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Report post to moderator
Monte Carlo method just means you simulate the event. a simple example would be rolling two dice. You can use math to compute all the possible outcomes and the frequency of each (NOT the M.C. method).

or, you could write a program that actually rolls two dice and computes the sum each time. It then keeps track of the results over (say) a million rolls, then computes the distribution.

so, the exact algorithm would depend on what exactly you are trying to simulate.
 
Bartender
Posts: 10777
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator

fred rosenberger wrote:...so, the exact algorithm would depend on what exactly you are trying to simulate.


So I guess the question here is: what kind of algorithm would you try to simulate to emulate a touch screen?

Not being a GUI bod, I wouldn't know, since I don't know what a touch screen provides you with as parameters; but I'd care to bet that x and y pixel coordinates are involved.

Winston
 
Tony Docherty
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
  • Report post to moderator

Not being a GUI bod, I wouldn't know, since I don't know what a touch screen provides you with as parameters; but I'd care to bet that x and y pixel coordinates are involved.


You are correct, you get exactly what you would get from a mouse, ie x, y co-ordinates etc
 
Tawi Oei
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Report post to moderator
Well, I don't know how to explain the connection between them but I need to know how to implement the Monte Carlo algorithm to create a touch screen program. My friend used the Monte Carlo algorithm to control a robot to avoid obstacles and put off fire. The problem is why did the robot go to a wrong direction? How to fix that? What is the math formula used by a Monte Carlo algorithm? Can any folks answer me with further details?
 
fred rosenberger
lowercase baba
Posts: 12800
51
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Report post to moderator
There is no ONE math formula for "The Monte Carlo method".

Nobody here can answer why "the robot went off in the wrong direction".

Please read my above post. The Monte Carlo Method (MCM) is nothing more than running millions of experiments, seeing what the results are, and computing the probability of an outcome based on real results.

the method for simulating a craps game via the MCM will be completely different from simulating a poker game, which is different from simulating roulette.

Have you done any basic research on the MCM, such as reading the wikipedia article on it? It seems to have a pretty good explanation to me...
 
Tawi Oei
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Report post to moderator
Yes, but I do not very understand about that, can you give me more details and other algorithms if Monte Carlo cannot solve this problem? How will the robot know that there are obstables in its way? My friend was graduated with B mark in his thesis, so how to fix it to make me able to get A in my thesis? Are there any other algorithms to solve this?
 
Tawi Oei
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Report post to moderator
So how can I know the time a woman will use my program and a man will use my program to make me able to make an event handler at the time a man or a woman use my program?
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Report post to moderator

Tawi Oei wrote:Well, I don't know how to explain the connection between them



Then you don't understand your own requirements. Nobody here can help you with that. You'll have to go back to the person that asked you to "implement the MonteCarlo Algorithm to be able to make a touch screen program" and ask him or her for clarification. Or ask your friend who already did it.

Tawi Oei wrote:So how can I know the time a woman will use my program and a man will use my program to make me able to make an event handler at the time a man or a woman use my program?



What does this have to do with anything you asked about so far?
 
Tawi Oei
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Report post to moderator
Well, I created a touch screen program. The program will not have any errors if a man uses this program and responses in the arranged time. The program will have some errors if a woman uses this program or a man use this program and wait too long to response to the program, how can I fix this? I will provide the code as soon as possible.
 
fred rosenberger
lowercase baba
Posts: 12800
51
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Report post to moderator

Tawi Oei wrote:So how can I know the time a woman will use my program and a man will use my program to make me able to make an event handler at the time a man or a woman use my program?


1) ask the user their gender
2) hope they tell the truth
3) use a timer to keep track of how long they use your program
 
Tawi Oei
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Report post to moderator

fred rosenberger wrote:

Tawi Oei wrote:So how can I know the time a woman will use my program and a man will use my program to make me able to make an event handler at the time a man or a woman use my program?


1) ask the user their gender
2) hope they tell the truth
3) use a timer to keep track of how long they use your program



Can you give me the example of the codes?
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Report post to moderator

Tawi Oei wrote:

fred rosenberger wrote:

Tawi Oei wrote:So how can I know the time a woman will use my program and a man will use my program to make me able to make an event handler at the time a man or a woman use my program?


1) ask the user their gender
2) hope they tell the truth
3) use a timer to keep track of how long they use your program



Can you give me the example of the codes?



If you "created a touch screen program", as you claim you did, then you should be able to figure out how to do these 3 simple things.

 
fred rosenberger
lowercase baba
Posts: 12800
51
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Report post to moderator

Tawi Oei wrote:Can you give me the example of the codes?


Nope. We don't give out solutions here. folks can help you, but you have to do it yourself.
 
Bartender
Posts: 612
7
Mac OS X Python
  • Mark post as helpful
  • send pies
  • Report post to moderator

So how can I know the time a woman will use my program and a man will use my program to make me able to make an event handler at the time a man or a woman use my program?



Well you could do a chromosome test for XX or XY. Would of course need a usb enabled device to obtain bodily fluid and perform the test, but it should have an api you can connect your code to.
 
Tawi Oei
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Report post to moderator
Well, what do you mean? If the user touch the screen, we need to know instantly the time the user touch the screen. We have to know whether the user is a man or a woman to respond correctly either. How to do this?
 
Rancher
Posts: 43011
76
  • Likes 1
  • Mark post as helpful
  • send pies
  • Report post to moderator
I think this has gone far enough; I'm closing this topic.
 
I've never won anything before. Not even a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!