设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 9954|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
; U* W4 c) {. O. f1 w, f2 D/ T! e0 G0 h$ 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中的数值,不知道会不会有什么不妥。. _8 H# `8 z2 l- E" P6 W- Q
0 S, R% d  C* ^9 h! Y; G1 b) g
begin P_read arriving, y: r$ A5 `1 M/ H, E9 ]8 k/ S
    while 1=1 do begin: I4 o4 M+ d6 g
        read A_tote from "data.txt" with delimiter "\n"
  P2 B9 R/ M( X5 j$ [        read A_time from "data.txt" with delimiter "\n"
" g4 n8 n6 f  e2 Y3 ?0 i        read A_leave from "data.txt" with delimiter "\n"# p  A- f. [6 r$ b
        read A_picks from "data.txt" with delimiter "\n"+ v# T9 ^! n7 u. m) n  e  |" ?
        set load type to A_tote$ g! H/ l& \2 x7 p7 `% o1 G& M
        if A_tote="tote 1" then set A_induct to 1" X3 k% P9 y- v$ w" D: @" h
        else if A_tote="tote 2" then set A_induct to 2  {# `* k1 s% a0 a. a  W
            else set A_induct to 3   
& A. Z- P2 d, q. _$ B* y        set A_i to 0% J5 Z5 I' S& Y
        clone 1 load to P_induction! X/ e( Q6 n+ v* |+ [8 @1 K# X: p; C
        wait for A_time sec" w$ h# e) H8 m: }# E  O  Y
    end/ Q8 N- p) R' }6 r; p
end
9 C- e+ k% A2 p8 K* ~& f. @
, M# s* |9 K5 Y# p- I: Lbegin P_induction arriving
& C& V9 v5 O+ b2 i8 C% b. [; v    if A_induct=1 then clone 1 load to P_pick1
& d$ Z* j* w0 }    else if A_induct=2 then clone 1 load to P_pick2
* ]& C! I( u8 w' d( g) k2 P# V        else clone 1 load to P_pick3
/ R( w8 h- B$ q% u( H) Pend# g% r  S! P; j# b3 H

4 Y. q' V2 Y% |* }! Wbegin P_pick1 arriving! n& J# c' C) @3 Q+ i" v
    set A_i to 1! J3 q# m8 |' {. a: I
    move into Q_induct1
2 E; {9 S$ a2 J' O    move into pickaisle.induct1! w: F/ u) C; e: V; L7 T
    while A_i<=30 do begin4 g: |0 K* Z. k; u
        travel to pickaisle.con(A_i)
; ]5 Z& X. ?' W2 j# D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 P$ o+ n+ P0 _' `# E% n, f
        else wait for 10 sec
* H) t# ^/ v! H. \3 a$ e3 D        if A_i=A_leave then send to die
$ H# P! P9 }& }0 J0 w        else inc A_i by 1
- G5 S4 V% I, l- N0 o    end! k8 T7 v3 H. G6 f5 o  [+ |. A2 t9 M
end; y9 B" U8 I- O; @  w

- T: {! c3 X3 f/ v) }$ fbegin P_pick2 arriving3 Z6 s" D3 d! ]& z) ^, Y
    set A_i to 11. p7 O6 g  w' {
    move into Q_induct2
0 h& j3 M, Z7 w/ C7 X7 |    move into pickaisle.induct2
1 I0 ]) t! _; O    while A_i<=30 do begin
  C3 M4 _1 H9 D( G9 c! i& U! ^        travel to pickaisle.con(A_i)
$ r2 `3 v8 `5 k7 F! v7 d* p* K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, f& v0 T6 K+ `7 k) c( |: G8 X4 y        else wait for 10 sec+ ], Y% U4 k* u% c3 J
        if A_i=A_leave then send to die8 ?$ m2 f; S( o  H
        else inc A_i by 1
2 y/ F- L  U3 Z* ~! d! S    end
% O) j6 b. d1 x6 Xend2 U/ J0 U% Q. a
) n' E) o6 j+ x) ~
begin P_pick3 arriving
, W4 A" b0 U0 s; d: e    set A_i to 21
3 i# D) N1 @* U7 K# Z    move into Q_induct3
8 s5 K( ^& R# e8 Q2 u: e    move into pickaisle.induct33 Z5 E: K/ i$ P% l" o
    while A_i<=30 do begin" x4 k1 o3 [( M
        travel to pickaisle.con(A_i)4 W& d5 @0 C& w" {5 F4 t$ O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& E0 R. r! v7 H5 Z4 p7 f. L- ]
        else wait for 10 sec
8 {5 G6 |7 d* W) _+ F% {/ i        if A_i=A_leave then send to die
( S! w0 |4 g' k) l" }3 b" ]        else inc A_i by 14 }' B2 x" t( }# A
    end
6 T- d7 ?' H& r; h2 C. I# Oend

最佳答案

查看完整内容

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是个什么东东?
2 H$ {! M& T$ s# z$ ?" {6 v; _move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
$ T0 {8 m7 M. ^6 B
& @; ], g# g$ p: v6 kAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) d: A' B$ H% ]' F. }$ }5 T
/ ], j: j6 G6 V1 H
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
/ J& e3 K9 O- R8 V  M) x1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
$ ^: b# q" b6 W$ s2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;8 X' B8 ?4 @* ?$ O- N" _' L
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:% E' t, N4 k+ a  k( _, b4 Y
begin P_induction arriving7 U5 b) d1 v4 p) p* q
    clone 1 load to P_pick(A_induct)# }* i: \: I' A* u: X
end最大的系
. V. A. I: m3 J3 l" j+ [! V5 G+ C" s$ q* K+ x+ e2 ]
begin P_pick arriving
; p0 [8 E9 S3 S, O3 H5 c    set A_i to procindex * 10 + 1
! p0 |" F$ O2 l6 L( ?0 g- t1 k    move into Q_induct(procindex)
5 M3 \* r( X0 e9 n7 j' @! ?# b1 L    move into pickaisle.induct(procindex)
+ `. c$ N4 l+ q, _    /*check the type of pickaisle.induct(i), for your last problem.*/
' L  l, T6 }  M! f+ q* ~% U$ `
7 z& F  w( k& E4 l. p9 R    while A_i<=30 do begin8 l  m2 s' j6 j1 f+ x
        travel to pickaisle.con(A_i)
# x: c" y9 A7 |: O9 A        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 d& H# R, l4 y7 |+ L7 i        else wait for 10 sec
; v/ T) ]: w6 ^        if A_i=A_leave then send to die6 g. X& m# g4 l
        else inc A_i by 1
/ b' b$ \% z  l" t% d8 Q    end) ?1 E0 }  Z$ t1 v5 x
end
2 r4 s+ B0 l, d* H. \# b
! N8 ^; C  _2 o' z- ]其中的procindex为整形,代表当前process的序号。
! L  J2 w; _- kstation和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-7-19 07:55 , Processed in 0.015600 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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