You are currently looking at Flamebate, our community forums. Players can discuss the game here, strategize, and role play as their characters.
You need to be logged in to post and to see the uncensored versions of these forums.
Vorheart's Flamebate Posts
View Vorheart's ProfileSearch Results | ||
---|---|---|
MySpace Tom opinions threadlambda = 0.124; tilesize = 0.25; beta = 2*pi/lambda; c = 299792458;
t_closest = inf; t_point = []; t_found = 0; t_cuts = 0;
if a.object_number > 0 for nobj = 1:a.object_number
obj1 = a.object_array(nobj);
if strcmp(obj1.rregion,current_ray.rregion)||strcmp(obj1.lregion,current_ray.rregion)||strcmp(current_ray.rregion,’Initial’Log in to see images!
f = 0; [f,i_t_values,i_points,i_facets,i_angle] = find_intersection(current_ray,obj1); if (f == 1)&&(current_ray.ignore ~= nobj) if t_found == 0 t_closest = i_t_values(1); t_point = i_points(1,Log in to see images!; t_face = i_facets(1); t_face2 = i_facets(2); t_found = 1; t_cuts = nobj; elseif i_t_values(1) < t_closest t_closest = i_t_values(1); t_point = i_points(1,Log in to see images!; t_face = i_facets(1); t_face2 = i_facets(2); t_found = t_found + 1; t_cuts = nobj; end end
end
end end if t_found > 0
current_ray.decay = t_point; current_ray.end_length = current_ray.starting_length + t_closest; c_rel_power = current_ray.acgreat timesulated_starting_losses.*(lambda./(4.*pi.*current_ray.end_length.*tilesize)).^2;
if c_rel_power >= min_relative_power chn = current_ray.children_number + 1; current_ray.children_number = chn; t_child = trans_child(current_ray,t_cuts,a.object_array(t_cuts),t_closest); f_child(chn) = follow_ray(a, t_child,min_relative_power);
chn = chn + 1; current_ray.children_number = chn; r_child = refl_child(current_ray,t_cuts,a.object_array(t_cuts),t_face,t_closest); f_child(chn) = follow_ray(a, r_child,min_relative_power);
current_ray.children_tree = f_child; end else
bounds = []; [t_ray, err_code] = ray_out_of_bounds(current_ray, bounds); current_ray = t_ray; end exit_ray = current_ray; (view post) |
12/16/2008 | |
MySpace Tom opinions threadfunction sensor_node_simulation() node_number = 1000; time_frames = 10000; lambda = 0.12; rand(‘twister’, sum(100*clock)); x_lim = [-100 100]; y_lim = [-100 100]; r_lim = [0 100]; phi_lim = [0 360]; node_distribution = ‘xy’;
switch node_distribution case ‘xy’ x = rand(1,node_number).*(x_lim(2)-x_lim(1)) + x_lim(1); y = rand(1,node_number).*(y_lim(2)-y_lim(1)) + y_lim(1); case ‘rphi’ r = rand(1,node_number).*(r_lim(2)-r_lim(1)) + r_lim(1); phi = rand(1,node_number).*(phi_lim(2)-phi_lim(1)) + phi_lim(1); [x,y] = pol2cart(phi,r); end
for i = 1:node_number node_field(i) = struct(‘x’,x(i),’y’,y(i),’state’,’idle’,’contest_wait’,1,’brxss’,-90,’txpower’,0,’rxs’,-70,’event_chance’,0.001,’sleep_chance’,0,’wakeup_chance’,0,’received’,0,’backoff’,0,’packet_data’,[],’prev_backoff_level’,0,’batcap’,10000,’battery’,10000); end
for i = 1:node_number linkage = {}; link_num = 0; for j = 1:node_number if i ~=j dist = ((node_field(i).x – node_field(j).x).^2 + (node_field(i).y – node_field(j).y).^2).^0.5; pathloss = 20.*log10((lambda./4./pi./dist)); if -pathloss < (node_field(i).txpower – node_field(j).rxs) link_num = link_num + 1; linkage{link_num}= {j, pathloss}; end end end node_field(i).link_num = link_num; node_field(i).links = linkage; end
node_display_r = [0 0; 0.25 0.25; 0.5 0.5; 0.75 0.75; 1 1; 1 1; 1 1; 1 1; 1 1; 0.75 0.75]; node_display_g = [1 1; 1 1; 1 1; 1 1; 1 1; 1 1; 0.75 0.75; 0.5 0.5; 0.25 0.25; 0 0]; node_display_b = zeros(10,2); node_display = cat(3,node_display_r,node_display_g,node_display_b);
cf = figure(‘Units’,’pixels’,’Position’,[200 50 625 625]); ca = axes(‘Parent’,cf,’Position’,[0 0 1 1]);
link_map = ones(625);
display_map(node_number,node_field,x_lim,y_lim,node_display,link_map,cf,ca); drawnow;
scaling_factor = 3;
for time_slot = 1:time_frames [node_field,link_map] = node_event_check_full(node_field,node_number,x_lim,y_lim,scaling_factor,link_map); if rem(time_slot,25) == 1 display_map(node_number,node_field,x_lim,y_lim,node_display,link_map,cf,ca); drawnow; end end (view post) |
12/16/2008 |