设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12336|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' i' v3 @9 B$ ]  A% n, ]

1 l  l, C2 c+ V! ~5 d; @9 L! Z我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 q) x: k5 {6 Z7 K* q9 [- l% a4 ~4 J
7 n& w6 U: Z6 t  Z" ~, Y. D: L
begin P_read arriving
/ M% K+ Y: F+ |  b1 ^, {    while 1=1 do begin7 n  n, \0 v# D$ H, I8 v6 N' l% I
        read A_tote from "data.txt" with delimiter "\n"
9 t8 M3 Y& X" ^1 ~5 ^% d        read A_time from "data.txt" with delimiter "\n", d/ N6 Q8 J& y; G+ n9 y& C
        read A_leave from "data.txt" with delimiter "\n"# X' Q" e& L7 ~. u" K- q( P
        read A_picks from "data.txt" with delimiter "\n"
' ?( ~. L4 H* Q! s  _5 C* e        set load type to A_tote" n! }: Q* w: W! f7 E2 a
        if A_tote="tote 1" then set A_induct to 1
' V' {4 X& {3 |! _. r        else if A_tote="tote 2" then set A_induct to 2! |7 \# x0 O0 {) h
            else set A_induct to 3    * A+ P( h9 Q6 m( G5 E
        set A_i to 0
7 o! C7 F! G$ P" \# ]  f        clone 1 load to P_induction5 Y9 ?5 v" `1 l3 r2 H1 T; Q
        wait for A_time sec9 r. N7 D" M% U4 A. d
    end; e& I% m% {$ f7 I
end
8 E2 k6 [" W1 y! |* T9 L$ x: o. q5 B/ s
begin P_induction arriving- z! O( v( x& o* h: J$ c& C' K7 D4 R
    if A_induct=1 then clone 1 load to P_pick1! V. r' G# E: I% G! }) B! u+ H
    else if A_induct=2 then clone 1 load to P_pick2! w3 z7 S5 T' _5 t7 ^
        else clone 1 load to P_pick30 W9 C1 @& Q/ Q0 b3 F1 m
end# Q/ B2 o2 ^- l" K
) r5 T' @0 D* a1 c
begin P_pick1 arriving
4 x# V7 y* n8 K; p% f- j    set A_i to 15 ^# V. W! j3 {2 H% l! a/ U
    move into Q_induct1
0 j" Z0 d' f" U4 ^$ g    move into pickaisle.induct11 R$ D5 K: n6 G
    while A_i<=30 do begin
- S" K% a. w  t# x$ ~* U6 y        travel to pickaisle.con(A_i), _  E/ i* @/ r3 Q, s; [6 X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& R3 v5 z/ c' q, x8 m
        else wait for 10 sec- O  z2 [- U7 o. S' W2 F8 X
        if A_i=A_leave then send to die
6 C8 L3 o7 F  b% Z5 z1 H        else inc A_i by 1
8 I. m' u. b6 H$ o  N' w+ D! b# B, [    end
6 k! \: u7 C( }( nend6 ^6 U8 R: [! C% i. n# V1 y

, W5 d) f& \2 u  ?( L: }begin P_pick2 arriving0 t" h! W% `3 a( Q9 `0 x
    set A_i to 11
$ C, J% j! h2 f+ q, g6 r    move into Q_induct2# u/ m9 m, J. i8 W
    move into pickaisle.induct29 F) d0 |: C, [6 ~/ K* z/ j
    while A_i<=30 do begin1 x  l; V5 e4 M
        travel to pickaisle.con(A_i)
) g( I' p9 X0 g1 Q. v) }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( r: ~" V/ h) f7 G        else wait for 10 sec+ Z2 K# \# G7 A/ ?
        if A_i=A_leave then send to die
# L' n* u' C% I8 ^2 l6 f* ?- J( n        else inc A_i by 1
" l; d- Y! U4 {5 s! N8 Z    end  @4 j9 f) Q5 b6 G4 a! |3 x# v
end
# @3 `7 k0 i% D
! p9 t6 d9 v; p, jbegin P_pick3 arriving& [& T7 P  ^' ^+ Y' T/ I# a
    set A_i to 21
! X' \# F; i0 N% Z2 r7 z    move into Q_induct3# B7 X) L+ r( l
    move into pickaisle.induct36 o9 y7 j) v/ J$ W3 Y: C3 ?
    while A_i<=30 do begin
, ?2 j' f4 ^3 z! z. c! M7 L; V        travel to pickaisle.con(A_i)
5 m! Y$ T, T3 _' B$ ^5 L# Y; Y- S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 q! ^* _0 N# W- d" b7 \- v        else wait for 10 sec
6 K$ K4 C& W5 ~/ n- t7 f        if A_i=A_leave then send to die  P$ N$ Y; [9 o( m% Z0 @6 ]
        else inc A_i by 1
6 e/ h4 q5 Z  i7 B# ^    end
* {3 u( |0 H! E; {5 cend

最佳答案

查看完整内容

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是个什么东东?
. x' l" ^- @6 ]9 q: }move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
8 d+ k( M- `) y6 i! M9 c, D; O2 I5 O3 Q2 l
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。" w- z4 j3 U. a' k. o9 c. Q/ c1 @5 x
# `3 I3 s( @$ a& q7 a
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:# b' y$ A6 t' R$ l+ j0 g: F
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
2 n. U; e' r5 q$ E9 U2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
# H% V2 x$ g/ W0 b" |# k3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 j5 r$ m( B+ Q3 `" _
begin P_induction arriving
* W2 J. J4 m  q7 N2 \7 E  T    clone 1 load to P_pick(A_induct)
5 ~# K& i+ _; Wend最大的系
- T% U! q0 V2 ^! ]% o) t# r' ]
' ]6 C0 f4 V2 \6 N5 h* z# L8 }) q: ebegin P_pick arriving/ z1 c+ u9 l7 i7 {' N+ C! I7 [
    set A_i to procindex * 10 + 1! u6 Y; L' P  l( e/ E
    move into Q_induct(procindex)
( l+ R7 Y; K$ D) M% v$ P    move into pickaisle.induct(procindex)
+ T# F5 x0 B/ {! w    /*check the type of pickaisle.induct(i), for your last problem.*/
# e% ?) U8 J$ G7 Z2 B( [8 j
* U5 n) v! p( }" b4 U' P1 k    while A_i<=30 do begin
2 I* B/ N. K  |$ `        travel to pickaisle.con(A_i)
/ s% f  |: Y" v* M4 A, d# S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 X) x* Q6 j. E  s+ |        else wait for 10 sec3 g1 a; ^0 X( n. p" _
        if A_i=A_leave then send to die
# e6 ~3 z) D" V* _" E        else inc A_i by 11 z; D) q- ~3 X* U4 X2 o: `
    end. j; u  K, R# _  e
end5 @0 {( C3 L* n% b- A2 Q, L7 K

) F- n" [  g4 b5 J3 {' M其中的procindex为整形,代表当前process的序号。
- g# t" X5 h# V& z5 j% Vstation和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-1-15 08:29 , Processed in 0.016006 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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