| 
					
				 | 
			
			
				@@ -101,8 +101,20 @@ public class PidLambdaContainer { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     String[] cols=line.split(","); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     Long creativeId=Long.parseLong(cols[0]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    Double lambdaNew=lambdaCache.getOrDefault(creativeId,0d)+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            kp*Double.parseDouble(cols[1])+ki*Double.parseDouble(cols[2])+kd*Double.parseDouble(cols[3]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//                    Double lambdaNew=lambdaCache.getOrDefault(creativeId,0d)+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//                            kp*Double.parseDouble(cols[1])+ki*Double.parseDouble(cols[2])+kd*Double.parseDouble(cols[3]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//                  Ecpm = CPA * pctr * pcvr * bid * lambad 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//                  Lambad = real_ctcvr / p_ctcvr (按上一个小时统计这两个值) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Double pctr=Double.parseDouble(cols[1]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Double pcvr=Double.parseDouble(cols[2]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Double ctr=Double.parseDouble(cols[3]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Double cvr=Double.parseDouble(cols[4]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Double lambdaNew=null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if((pctr*pcvr)==0d||ctr*cvr==0d){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        lambdaNew=1d; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        lambdaNew=cvr*ctr/(pctr*pctr); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     lambdaCache.put(creativeId,lambdaNew); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 }catch (Exception e){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     e.printStackTrace(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -150,6 +162,6 @@ public class PidLambdaContainer { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public static Double getPidLambda(Long creativeId){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return lambdaCache.getOrDefault(creativeId,0d); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return lambdaCache.getOrDefault(creativeId,1d); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 |