设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11287|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 w% @) @: E4 n; ^3 ^8 G4 M7 \1 Q$ a. N; \* K8 t
我的问题是,在每个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中的数值,不知道会不会有什么不妥。: A1 T: R  f- U% Y9 J" _

" E, J' K6 L9 X. |begin P_read arriving
8 @& H$ ]2 e# B* m7 g    while 1=1 do begin
/ X, ?; [: ]. K5 n+ e        read A_tote from "data.txt" with delimiter "\n"
& M7 g& p/ m0 K7 X        read A_time from "data.txt" with delimiter "\n"5 j2 D3 E1 D+ [$ o* @. `% Y
        read A_leave from "data.txt" with delimiter "\n"
9 P2 W) u, B# O# X- I7 O- B# ]        read A_picks from "data.txt" with delimiter "\n"2 ?, R3 F$ `" Y- ~2 I  ?* q9 ]+ g: d
        set load type to A_tote! r7 J4 S, m. Q$ |. R- I! o
        if A_tote="tote 1" then set A_induct to 1
7 H7 `; T6 c& D6 a/ O" j        else if A_tote="tote 2" then set A_induct to 2
9 c( i+ N" W8 `$ T. G" @( ?+ r            else set A_induct to 3    9 G6 ^, v! X1 n( Q! c: a
        set A_i to 0( i1 o% h- Z5 L4 o4 [, y
        clone 1 load to P_induction
( R. r( a+ K! R' P        wait for A_time sec1 w  ]# L$ {# I; g
    end3 E  C& z$ i0 y! V
end
+ O4 l1 B& H) s+ Y! x; d% R- M" k6 }5 z# W
begin P_induction arriving9 \  h8 E* Q$ L2 s3 \* r
    if A_induct=1 then clone 1 load to P_pick1
& u: [/ k) J- z/ W9 O+ A9 M    else if A_induct=2 then clone 1 load to P_pick2" M7 c% J6 ?! F5 Y  D/ D
        else clone 1 load to P_pick3
8 }$ V4 l+ b  D; ~/ u9 F& Lend# a6 Q& F& X& O4 `3 T  M& ~
# D( q( y& K1 |
begin P_pick1 arriving
+ Z% m; }# |5 X; y& [    set A_i to 1
( E5 ]9 l/ o3 ^& C% I7 q    move into Q_induct1$ h* l* M# A3 X/ o. }4 K
    move into pickaisle.induct11 {& G* L$ u: q8 w2 O
    while A_i<=30 do begin7 W- ?6 f2 [& r" c0 }
        travel to pickaisle.con(A_i)
% J% j, |3 Q; h  ~3 C" n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! G- ^& H& M/ x8 A) [        else wait for 10 sec3 N/ X! ~  V" [
        if A_i=A_leave then send to die; s6 e) v. T( ^+ m+ I- J
        else inc A_i by 1" W/ p4 N! T8 j5 j
    end
0 u4 B9 a% S* ~0 R8 X! `* G  H! Qend
: ]: O8 b4 h; a$ L( N: @2 d. y3 Y8 x9 {
begin P_pick2 arriving
$ v7 e! }4 ^- w" E& F# d, H    set A_i to 11# z# |8 R& R4 b" i) H
    move into Q_induct2
& {9 M+ S* t+ o    move into pickaisle.induct24 X; w( v: _2 s% v- |
    while A_i<=30 do begin* E* _; w) b& u$ q) C; F$ `2 M
        travel to pickaisle.con(A_i)
. d; x% F' S9 C' q7 A        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ J2 h2 p- h; g9 a5 T" S        else wait for 10 sec
6 a: B' I( v) A6 t* O6 X9 K  y        if A_i=A_leave then send to die
% e' Y( \; |$ L$ M' x        else inc A_i by 1
" m, e1 W2 s) _# y6 Y    end( Q# W' }* U% I% b4 j! A3 A( f
end
# F/ ]0 ~4 [) x- r4 M7 l5 i
. _9 m8 y( \2 ?& f6 L2 t2 Rbegin P_pick3 arriving7 n, Q5 }) z' ~6 t" }% o& D
    set A_i to 21
4 _2 a3 |, i0 H" s5 s, ?, G    move into Q_induct3/ }) @5 n; j" ^$ z
    move into pickaisle.induct3
8 O# D6 n! ?5 H  {% c. k    while A_i<=30 do begin
9 v- @( c/ T% @  F5 B% V! c( V        travel to pickaisle.con(A_i)
( |! k8 ?4 n/ L* e3 A3 ^' \( m( B        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# W% q. d9 R4 R+ o        else wait for 10 sec. p1 v% k0 D3 J' H$ x; S
        if A_i=A_leave then send to die$ n% [. T( S* k. P% s
        else inc A_i by 13 s" G+ Z# J0 J5 S2 ?! ?1 g
    end" A& M2 `! }+ U" L! M3 h
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是个什么东东?, M( ~4 O. w3 j8 M( q1 ]2 E
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?$ b! C" h' [" x! i* W, K- g( ?
/ t) R. @; }9 w4 i# Y4 D
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
- K! J, J0 k  b6 t  e) d3 u) S4 A& t$ K* o
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
- Q% @- p7 _$ f( q1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
1 H6 _! Q& c- N8 C2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
& Y  {- L* B' L2 n0 Y3 r3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:. k9 F0 G1 z- N' W4 p
begin P_induction arriving
+ J2 W  c# k# x+ q    clone 1 load to P_pick(A_induct)$ q3 \/ X- [4 }1 V. e
end最大的系) p  L  m  r8 g7 P# s9 O, r
% b9 U3 Z5 F: J
begin P_pick arriving5 W6 r+ y7 z# v& I9 c
    set A_i to procindex * 10 + 1
" k: C6 `) Y7 q: c% h" F7 h! B3 i    move into Q_induct(procindex), x3 J# c5 C" p6 P6 T* \$ Y
    move into pickaisle.induct(procindex)
' A& v8 s( h5 \    /*check the type of pickaisle.induct(i), for your last problem.*/" e. N# q4 T, h

' S4 p8 w/ j/ o& g) r  W3 S2 K) x    while A_i<=30 do begin
2 W5 p2 P/ \  S" m' Y" o0 [" T        travel to pickaisle.con(A_i)! b8 `0 X' I/ [( A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 l# l: h) A1 q. s  }        else wait for 10 sec
, _3 U, N& B( X  h3 P( ^        if A_i=A_leave then send to die0 o: J7 Y2 r5 X- U0 C+ \2 |
        else inc A_i by 1
3 s9 g( y& [; M# N! b7 ?4 s* Z/ g    end
5 u1 h& U. }3 o" Y# R$ Z6 u% u7 rend
; F: N/ c. ?! C( X) T. _$ I8 T: g$ s: O
其中的procindex为整形,代表当前process的序号。
4 n. n' k# u; ?9 s9 P% Jstation和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, 2025-11-5 21:19 , Processed in 0.016630 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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