设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14934|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
% K; S/ n9 F6 C, y' j' N
7 \6 _$ T9 ~1 }7 M9 C! W) R我的问题是,在每个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中的数值,不知道会不会有什么不妥。
: b, n3 J) H) C( |
7 A! ~4 u3 Q2 o1 `* Obegin P_read arriving
1 l9 W5 i3 g5 B& v    while 1=1 do begin
: z5 B' n; f$ _& @( E) r        read A_tote from "data.txt" with delimiter "\n"
* S6 p3 w! N  }+ d        read A_time from "data.txt" with delimiter "\n"$ a; E7 x& ?0 n) k
        read A_leave from "data.txt" with delimiter "\n"+ s- S2 l; H% G# K4 J( E* X$ [5 Y- P
        read A_picks from "data.txt" with delimiter "\n"
( p  b9 y5 T1 ^# ^- l% t( h# R        set load type to A_tote5 T% ~' h6 M# S- f, s$ i8 v
        if A_tote="tote 1" then set A_induct to 1
6 ^! W1 J9 n2 Q+ R) @, Z( U4 p        else if A_tote="tote 2" then set A_induct to 2
' G# n& G+ x( h9 {            else set A_induct to 3    - p! c) p) B- D, z8 ?% z4 p/ x* l
        set A_i to 0
! [1 h: y* w6 i        clone 1 load to P_induction# b' P6 H* `( P6 V+ k- D/ r3 M3 _5 X
        wait for A_time sec& ]5 ^2 K0 R7 j- {8 D3 N7 R5 ~) ^
    end* ?7 I6 ?/ K4 L9 I5 o3 S
end$ ~, j: G& Y1 O0 |0 r& b& E/ ?

4 p4 Q" O- i  m$ ]begin P_induction arriving/ n; {) [. a; F( Y: L
    if A_induct=1 then clone 1 load to P_pick1
8 c2 ^- T. Z6 _0 v" J$ Q    else if A_induct=2 then clone 1 load to P_pick2
( H) G& Y! M2 D        else clone 1 load to P_pick3
, G& ?4 p8 O/ U2 eend# w# ?) x3 N) Z& ~
3 }- e  q4 Z$ `
begin P_pick1 arriving
# M( o6 _1 j+ e4 W4 V# L    set A_i to 1/ R% J7 M$ @" R' s: c; `' ^* Y/ M+ m
    move into Q_induct1( V! E# G3 m$ D. o5 f
    move into pickaisle.induct1; e' J- N0 V! F5 l
    while A_i<=30 do begin
% @" m, C0 D6 {. b7 T8 m        travel to pickaisle.con(A_i)
- d) p1 a2 u  h# I9 w5 a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# `1 t; d+ F- a        else wait for 10 sec
5 s3 Q; J$ v7 l$ I6 ~        if A_i=A_leave then send to die6 O4 L; a$ C+ Q. f- ?+ h
        else inc A_i by 1# D4 D7 N) U# |% \
    end
* i: D% Z. S. Dend
/ X) V6 f: q$ \) ~7 f8 `; _9 ^) k  L3 T8 o- O2 w7 A# U8 h
begin P_pick2 arriving, k0 u2 U; q( H% w! b$ |; s: o* t
    set A_i to 11% r/ M- Z, C* L
    move into Q_induct2
" N, Z& G" v* ^    move into pickaisle.induct2+ s* P# {2 }/ W) X- {! [) F
    while A_i<=30 do begin$ Y. p% [  s; Y/ Y5 d# f; C5 D$ a+ ~
        travel to pickaisle.con(A_i)
' \1 z  _& c. u0 Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 a& F8 i: D7 v1 l        else wait for 10 sec- }9 o: {, Z3 E1 d. v
        if A_i=A_leave then send to die! m! M  g/ m& F" ~+ `5 |0 w4 X
        else inc A_i by 1- j" F/ `8 {: J$ ?6 G' U$ {
    end. m0 I0 N8 r$ i' Q6 u5 V% @: C9 L
end7 R8 h4 H" L0 D' y/ n

# x0 L/ v% }; ]2 b; ?% Wbegin P_pick3 arriving
6 F# e; s0 H* ~) `    set A_i to 21
4 T9 e. c" B! s; s3 G& _6 A    move into Q_induct3
! M2 u9 L: j9 ]( Z4 S7 C    move into pickaisle.induct3$ g7 n" m0 U3 h( O4 L* _! ^$ F
    while A_i<=30 do begin! \: M9 }" G+ s
        travel to pickaisle.con(A_i)- J4 c+ p+ j0 f9 T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 j4 |' C: }* s4 z* K        else wait for 10 sec. `* ^" H6 a: u) ?- h6 r7 `4 `
        if A_i=A_leave then send to die
& @" G! m6 j3 @: \3 g2 h        else inc A_i by 1
% G0 |5 J1 M/ h    end& l1 x7 f9 d' h$ R* Q2 C7 N
end

最佳答案

查看完整内容

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是个什么东东?
0 y1 N) f/ }0 v, d& u% P0 [5 omove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
5 `# ]0 l7 R+ W- C7 E- q- }) ?7 A, j3 T# x' Z
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
& O+ V' q/ P- x# z$ B2 p9 D& g) u* r- R( i, J: ~3 i5 `
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:* o  p3 C7 i) c; z" ?. \* w
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
  \# i0 {! L1 S$ U1 ~% b! L. h; Q2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
$ v! |5 r) \1 w9 {$ X3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:2 _' A) v6 W+ b9 O
begin P_induction arriving
) m* c: B6 E0 v  B7 q8 W; M    clone 1 load to P_pick(A_induct), b" E1 }; U% X' I
end最大的系, c* L2 z& [4 t% u# z+ z$ j

, [3 X, d5 k. v6 \1 T: Ubegin P_pick arriving+ X% l4 |! M3 m
    set A_i to procindex * 10 + 1# {6 z0 U: I" ^  e0 ^: c: Q+ J0 q
    move into Q_induct(procindex): l  h" n3 z3 c0 H+ l
    move into pickaisle.induct(procindex)1 M$ j! |: V- h  q) c" |
    /*check the type of pickaisle.induct(i), for your last problem.*/  I, a. g! w8 q
. \/ M, i- H4 W9 [% k6 U
    while A_i<=30 do begin
2 P9 ~0 N: j4 E/ X        travel to pickaisle.con(A_i), I  m6 t! I( L# j1 @# B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" `7 {7 _3 b, c8 A1 ~        else wait for 10 sec; i$ T0 \5 k# i3 d- d, N7 f
        if A_i=A_leave then send to die
. M% A) F$ T2 b        else inc A_i by 1
; l& o: }0 I& Z9 f# Q2 e1 f/ L    end
- f: X5 _1 m" z8 Q0 ?# ~5 send
; M0 F: E5 A5 ?2 v& _' q
( Z. P3 L- A/ K4 Z7 p4 E. a其中的procindex为整形,代表当前process的序号。: @! A/ T8 B- c% l
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-8-1 05:43 , Processed in 0.016632 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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