设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14121|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 T" j1 w% a2 V4 h* d6 F8 J3 H+ R0 Y' A0 {
我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。
. E  s& w/ [4 {0 x
- W) C' v  }' P9 q6 ~( fbegin P_read arriving
2 Q9 K* ^, b- C0 f+ _+ d$ ^    while 1=1 do begin
2 u3 A* [1 m* x' R        read A_tote from "data.txt" with delimiter "\n"2 j; K' \) C- ]; d
        read A_time from "data.txt" with delimiter "\n"
- n) e0 n$ T! N        read A_leave from "data.txt" with delimiter "\n"
. B4 c" Z0 P) M( l3 D        read A_picks from "data.txt" with delimiter "\n"
* Q# H/ N6 I3 o$ P+ l        set load type to A_tote
7 [& U! m' X/ o: r% d        if A_tote="tote 1" then set A_induct to 12 Z# Y# L8 ^$ W# `' R8 m
        else if A_tote="tote 2" then set A_induct to 2
* {2 }$ R' N" T6 y5 X            else set A_induct to 3   
; v0 e% R* C# E2 y/ W        set A_i to 0
/ z" f* ?8 u3 f8 i7 Z        clone 1 load to P_induction
$ o- @$ M, a7 a9 c        wait for A_time sec; b0 x+ C9 n4 M8 R# {  k
    end- h3 p- a. h6 a7 b2 M) S0 M# `" i
end
4 e1 d  d- T3 ~4 I& p% q' A
8 a; _! u5 u" X- l* i/ y1 `& Bbegin P_induction arriving
: W2 p  e, ]. L    if A_induct=1 then clone 1 load to P_pick1/ y( n. I4 l5 W  @4 \0 ^; n
    else if A_induct=2 then clone 1 load to P_pick2
/ }* ?$ k1 L! Z4 b3 l        else clone 1 load to P_pick34 k) B: b* w: [+ s8 Z9 @: m* i1 h
end
0 R$ @" k( M4 d0 M
- u) i0 F* [  W. E/ dbegin P_pick1 arriving2 ~, w9 L$ K4 ~2 i$ F5 G1 E6 f
    set A_i to 1% k' ?" }1 G0 \+ ^, [0 Q2 G2 K# c
    move into Q_induct1
3 C! ^2 T- d0 `( ^" ~    move into pickaisle.induct1
6 N4 K3 k# h( |! @0 W: C3 ?  Y    while A_i<=30 do begin8 X5 [$ w' q3 n% j# J% }
        travel to pickaisle.con(A_i)
1 N5 i0 D( ~0 _6 \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 b6 u0 p* ^  R% f. ?: E
        else wait for 10 sec* \2 U6 l  c8 L$ C: o" c
        if A_i=A_leave then send to die
, D! }2 k9 h$ z4 q2 i2 K        else inc A_i by 1
: e; i- |" I7 ]6 S! V    end
2 @; C) S5 K3 D3 R2 ^  h; S( Hend& r8 A5 m+ c# O, h' L# Y6 Q+ e

0 T: m; }% e4 s6 ~begin P_pick2 arriving
' `. h. @* f  _. u2 g' d    set A_i to 11
: ?6 R# z9 N8 [3 n' j    move into Q_induct2
7 [" c5 f9 n# M    move into pickaisle.induct2) _. l( k$ u, d( j
    while A_i<=30 do begin
: y7 _7 J+ f9 ^" ^( w; F' w; e! [3 d        travel to pickaisle.con(A_i)
/ H6 t7 ~- x1 {6 h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& t; u5 P) L3 f  p. z$ u! s
        else wait for 10 sec+ V  j7 i% z; J" E2 h2 i: ]6 g
        if A_i=A_leave then send to die
( o( b, Z  s4 d3 U, l0 I5 Y        else inc A_i by 13 S+ x8 A* h" y5 {4 U# }- j
    end5 c! k; |- [- f5 B  O  s8 c3 X
end2 D# Q* y4 B; Z. {6 i2 Q' J

. U9 D9 u+ s$ L; Z3 L; L5 W+ qbegin P_pick3 arriving
6 Y8 v+ Y& K1 a0 u% h' Q9 e    set A_i to 215 n6 ^2 G7 g; X4 }
    move into Q_induct3
9 ^( J) z, J1 J- Z7 M! }    move into pickaisle.induct35 t7 N% V7 s, @  X
    while A_i<=30 do begin. L$ e- i( Z: Q7 @
        travel to pickaisle.con(A_i)7 o$ k& E$ I8 d: r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, G$ o0 |8 Z) [* {- V: m; N$ ?
        else wait for 10 sec
/ q2 h4 Q% u1 {# q& ~        if A_i=A_leave then send to die& o# \1 h9 |. \* q; }. Y
        else inc A_i by 14 K: @# Q6 z) I1 t, u5 S6 M- s
    end
, Q( ?5 o5 J, [' Zend

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?+ D8 Q6 g: h" R' D
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
/ O3 H7 X5 }- _6 F- p. Y% p2 p' I# d' a) P% n! a
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
+ v  m  w' W; Q- o, a# X+ z! o* k. Q( H
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
. X$ _/ c/ k* P( G# |2 d* v1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;/ y1 M- R# S; }* T+ t9 H
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;; M0 |( b  Z& u! m( h
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
1 w. |( ~9 u' f. N# [1 F3 K: _# h1 Zbegin P_induction arriving5 t' Y4 M" O) Q% f3 s9 k
    clone 1 load to P_pick(A_induct)
) b9 m, P: j9 R& g7 r7 kend最大的系
3 L6 M9 R0 B5 Z
, c  Q1 M0 O$ z0 E& f# e, L% L) I- H) Obegin P_pick arriving$ l! b; V$ ?# W. M
    set A_i to procindex * 10 + 1% L: X- g8 X' J$ ^
    move into Q_induct(procindex)
  y7 u1 v$ G/ \7 T, k" S* X6 [    move into pickaisle.induct(procindex)5 O" |1 _- ]; [+ w# N# \
    /*check the type of pickaisle.induct(i), for your last problem.*/
5 F  p# \% L5 d
4 |4 ]1 K9 e6 B, H; A    while A_i<=30 do begin7 K; x4 b3 Y( ]& e% `
        travel to pickaisle.con(A_i)7 E& R* F3 v6 E' E( Y# l8 b6 {( @, \6 f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. i; O- h% S' m" u
        else wait for 10 sec
- |' f' E0 g) O, k: s. {" l        if A_i=A_leave then send to die6 y4 d. X+ w4 U3 W- o6 H
        else inc A_i by 1( i( _! Q5 `6 [8 h  W: D
    end) A1 k6 c4 u" K" {0 w
end
7 n' K9 t# [! r% m0 K- E% C: ?" `9 Y& }
其中的procindex为整形,代表当前process的序号。) B2 X- W, F; t8 `& g6 F# Q
station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-6-10 23:03 , Processed in 0.019810 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表