小编Rya*_*her的帖子

2d三边测量

我正在编写一些代码来参与AI挑战.人工智能挑战的主要目标是采用模拟机器人并将其通过迷宫导航到目的地区域.可选的次要目标是找到放置在未知位置的迷宫中的充电器.这都是在2D网格中完成的.

我的程序可以调用一种方法从充电器获取距离测量值.因此,使用三边测量,我应该能够通过调用此方法,记录我的艾未未的当前位置和充电器是从该点超过3倍远的距离,找到充电器.

我在维基百科http://en.wikipedia.org/wiki/Trilateration上找到了这个trilateration的例子,但这适用于3d空间.我只处理2D空间.此外,我不明白如何使用维基百科中显示的公式,在网络上搜索插入数字的工作示例,并且谷歌搜索很少沸腾到最终坐标.

我不是数学专业; 我只是一个探索AI问题的狂热爱好者.

如何计算问题的解释和分步示例是我需要的,因为数学不是我的强项.以下是一些示例数据:

  • 点1:x = 39,y = 28,距离= 8
  • 第2点:x = 13,y = 39,距离= 11
  • 第3点:x = 16,y = 40,距离= 8

任何使用我的样本数据的例子都将非常感激.一旦我能够掌握数学知识,编程就会非常直接.

artificial-intelligence trilateration

5
推荐指数
1
解决办法
1万
查看次数

在jython中使用枚举

试图在Jython中使用Java Enum但我无法弄清楚如何使用它们.

导入时我看到列出的枚举,BotInterface$MOVE所以我放下了这一行

from amazebot2012.BotInterface import MOVE
Run Code Online (Sandbox Code Playgroud)

在Java中,我通常会将其用作

bot.move(MOVE.FORWARD);
bot.move(MOVE.BACKWARD);
Run Code Online (Sandbox Code Playgroud)

一旦我导入它,Jython等价物是什么?

尝试bot.move(MOVE.FORWARD)给我错误:

来自导入的未定义变量:FORWARD

python java jython

5
推荐指数
1
解决办法
1667
查看次数

Xamarin AlarmManager Android

我已经创建了一个快速的xamarin android项目.最后我想学习下面的学习并将它应用到android和ios之间共享的xamarin表单项目中.现在我只关注Android方面的事情.

我一直在努力学习如何安排本地通知在将来的某个时间出现.快速扔掉应用程序,下面是我编写的AlarmReceiver类,以及下面的MainActivity.cs.

class AlarmReceiver : BroadcastReceiver
{
    public override void OnReceive(Context context, Intent intent)
    {
        var message = intent.GetStringExtra("message");
        var title = intent.GetStringExtra("title");

        var notIntent = new Intent(context, typeof(MainActivity));
        var contentIntent = PendingIntent.GetActivity(context, 0, notIntent, PendingIntentFlags.CancelCurrent);
        var manager = NotificationManager.FromContext(context);

        //Generate a notification with just short text and small icon
        var builder = new Notification.Builder(context)
                        .SetContentIntent(contentIntent)
                        .SetContentTitle(title)
                        .SetContentText(message)
                        .SetWhen(Java.Lang.JavaSystem.CurrentTimeMillis())
                        .SetAutoCancel(true);

        var notification = builder.Build();
        manager.Notify(0, notification);
    }
}

public class MainActivity : Activity
{
    // Unique ID for our …
Run Code Online (Sandbox Code Playgroud)

c# android xamarin.android xamarin

4
推荐指数
1
解决办法
1万
查看次数