Click here to Skip to main content
15,911,891 members
Home / Discussions / Java
   

Java

 
GeneralRe: Error Message - HTTP 500 & Error Message - no servlet mappings in web.xml Pin
karengsh30-Dec-09 5:06
karengsh30-Dec-09 5:06 
GeneralRe: Error Message - HTTP 500 & Error Message - no servlet mappings in web.xml Pin
Richard MacCutchan30-Dec-09 5:41
mveRichard MacCutchan30-Dec-09 5:41 
QuestionProb in reading .mtl file format. Pin
002comp27-Dec-09 19:35
002comp27-Dec-09 19:35 
Questioncall by value for objects Pin
mesho26-Dec-09 8:52
mesho26-Dec-09 8:52 
AnswerRe: call by value for objects Pin
Luc Pattyn26-Dec-09 9:18
sitebuilderLuc Pattyn26-Dec-09 9:18 
GeneralRe: call by value for objects Pin
mesho26-Dec-09 10:33
mesho26-Dec-09 10:33 
GeneralRe: call by value for objects Pin
Luc Pattyn26-Dec-09 10:38
sitebuilderLuc Pattyn26-Dec-09 10:38 
GeneralRe: call by value for objects Pin
mesho26-Dec-09 10:54
mesho26-Dec-09 10:54 
my code is very long, that's why i don't write it before

i'm writing a program for multiprocessor using genetic algorithm

<br />
ArrayList <schedule> POP=new  ArrayList <schedule>();			<br />
		for(int i=0;i<10;i++)<br />
	    		POP.add(generate_schedule());<br />
<br />
ArrayList <schedule> TMP=new ArrayList <schedule> ();<br />
	    		<br />
	    		<br />
	    		for(int j=0;j < NPOP.size()/2;j++)<br />
	    		{<br />
	    			schedule s1=NPOP.get(j);<br />
	    			<br />
	    			schedule s2=NPOP.get(j+(POP.size()/2));<br />
	    			<br />
	    			Random rand=new Random();<br />
	    	        double r=rand.nextDouble();<br />
	    			if(r<=CrossOver_prob)<br />
	    			{<br />
	    				ArrayList <schedule> result=new ArrayList <schedule>();<br />
	    				result=crossover(s1,s2);<br />
	    				TMP.add(result.get(0));<br />
	    				TMP.add(result.get(1));<br />
	    			}<br />
	    			else<br />
	    			{<br />
	    				TMP.add(s1);<br />
		    			TMP.add(s2);<br />
	    			}<br />
	    			<br />
	    		}<br />
<br />
for(int j=0;j < TMP.size();j++)<br />
	    		{<br />
	    			System.out.println("schedule"+j);<br />
	    			Random rand=new Random();<br />
	    	                double r=rand.nextDouble();<br />
	    			if(r<=Mutation_prob)<br />
	    				POP.add(Mutation(TMP.get(j)););<br />
	    			else<br />
	    				POP.add(TMP.get(j));<br />
	    		}


my problem is on the bold line when calling mutation all schedules in TMP is changed

hope its clear now Smile | :)
GeneralRe: call by value for objects Pin
Luc Pattyn26-Dec-09 11:22
sitebuilderLuc Pattyn26-Dec-09 11:22 
GeneralRe: call by value for objects Pin
Cedric Moonen26-Dec-09 22:45
Cedric Moonen26-Dec-09 22:45 
GeneralRe: call by value for objects Pin
mesho27-Dec-09 5:38
mesho27-Dec-09 5:38 
AnswerRe: call by value for objects Pin
April Fans18-Jan-10 15:28
April Fans18-Jan-10 15:28 
QuestionProblem in showing Illumination(shadowness) Pin
002comp23-Dec-09 0:48
002comp23-Dec-09 0:48 
AnswerRe: Problem in showing Illumination(shadowness) Pin
TorstenH.23-Dec-09 1:58
TorstenH.23-Dec-09 1:58 
GeneralRe: Problem in showing Illumination(shadowness) Pin
002comp23-Dec-09 18:58
002comp23-Dec-09 18:58 
QuestionTextureLoader In Java 3d API Pin
002comp22-Dec-09 20:48
002comp22-Dec-09 20:48 
AnswerRe: TextureLoader In Java 3d API (Solved) Pin
002comp22-Dec-09 22:00
002comp22-Dec-09 22:00 
Questionjava security Access Control Exception Pin
sangeethanarayan22-Dec-09 1:23
sangeethanarayan22-Dec-09 1:23 
AnswerRe: java security Access Control Exception Pin
TorstenH.22-Dec-09 1:58
TorstenH.22-Dec-09 1:58 
QuestionReset Canvas Problem Pin
002comp21-Dec-09 23:21
002comp21-Dec-09 23:21 
AnswerRe: Reset Canvas Problem Pin
002comp22-Dec-09 20:49
002comp22-Dec-09 20:49 
QuestionHow to get all url of a website Pin
sharkbc21-Dec-09 22:58
sharkbc21-Dec-09 22:58 
AnswerRe: How to get all url of a website Pin
Nagy Vilmos22-Dec-09 1:18
professionalNagy Vilmos22-Dec-09 1:18 
QuestionJar File Not working properly Pin
002comp21-Dec-09 21:12
002comp21-Dec-09 21:12 
AnswerRe: Jar File Not working properly Pin
Richard MacCutchan21-Dec-09 21:32
mveRichard MacCutchan21-Dec-09 21:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.