javafx给图形上颜色_在JavaFX中着色一条线并改变这种颜色(Coloring a Line in JavaFX and Varying this color)...

I am new to JavaFX. I was trying to carry out a graphical implementation of an Ant Colony Optimization Algorithm. My version is very simple and involves ants moving in a 2D Cartesian plane, depositing pheromones if and when they find food.

I have written some code in JavaFX which creates a circular node representing the ant and moves it about on the scene of the stage and I think I'll be able to extend this to multiple ants too.

But I want to know how to color the line joining the ant's current position and it's previous position. Basically when the ant finds food and starts returning to the colony, it has to deposit some pheromone along its path and I want this path to be colored as the ant moves along it. Also the pheromone is supposed to evaporate with time. I have an array that stores this value of pheromone strength. So is it further possible to reduce the hue of the color of the line in proportion with the number(pheromone value)?

Thanks.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值